I would like to add oauth/openID connect configuration under service provider in wso2. How i will add these configuration using soap request. pls help me on that.
Asked
Active
Viewed 154 times
0
-
What is the version of IS that you use? – Anuradha Karunarathna Jun 18 '21 at 15:01
-
wso2is v5.8 @AnuradhaKarunarathna – Vijay Yadav Jun 21 '21 at 10:16
1 Answers
0
- Register OAuth app data(https://localhost:9443/services/OAuthAdminService?wsdl)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://dto.oauth.identity.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:registerOAuthApplicationData>
<!--Optional:-->
<xsd:application>
<!--Optional:-->
<xsd1:OAuthVersion>OAuth-2.0</xsd1:OAuthVersion>
<!--Optional:-->
<xsd1:applicationAccessTokenExpiryTime>3600</xsd1:applicationAccessTokenExpiryTime>
<!--Optional:-->
<xsd1:applicationName>webapp</xsd1:applicationName>
<!--Optional:-->
<xsd1:callbackUrl>http://localhost:8080/webapp/oauth2client</xsd1:callbackUrl>
<!--Optional:-->
<xsd1:grantTypes>refresh_token urn:ietf:params:oauth:grant-type:saml2-bearer implicit password client_credentials iwa:ntlm authorization_code</xsd1:grantTypes>
<!--Optional:-->
<xsd1:pkceMandatory>false</xsd1:pkceMandatory>
<!--Optional:-->
<xsd1:pkceSupportPlain>true</xsd1:pkceSupportPlain>
<!--Optional:-->
<xsd1:refreshTokenExpiryTime>84000</xsd1:refreshTokenExpiryTime>
<!--Optional:-->
<xsd1:userAccessTokenExpiryTime>3600</xsd1:userAccessTokenExpiryTime>
</xsd:application>
</xsd:registerOAuthApplicationData>
</soapenv:Body>
</soapenv:Envelope>
- Get OAuth Application data by name (https://localhost:9443/services/OAuthAdminService?wsdl)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd">
<soapenv:Header/>
<soapenv:Body>
<xsd:getOAuthApplicationDataByAppName>
<!--Optional:-->
<xsd:appName>webapp</xsd:appName>
</xsd:getOAuthApplicationDataByAppName>
</soapenv:Body>
</soapenv:Envelope>
Note : oauthConsumerKey
and oauthConsumerSecret
from the response
<ax2402:oauthConsumerKey>kCVqngLf6fs0lQeXZwxL16ArRrAa</ax2402:oauthConsumerKey>
<ax2402:oauthConsumerSecret>jauiJEAICB7Klk5us6FMSWjeEJoa</ax2402:oauthConsumerSecret>
- Create an application (service provider) ( https://localhost:9443/services/IdentityApplicationManagementService?wsdl)
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://model.common.application.identity.carbon.wso2.org/xsd" xmlns:xsd2="http://script.model.common.application.identity.carbon.wso2.org/xsd">
<soap:Header/>
<soap:Body>
<xsd:createApplication>
<xsd:serviceProvider>
<xsd1:applicationName>sample</xsd1:applicationName>
</xsd:serviceProvider>
</xsd:createApplication>
</soap:Body>
</soap:Envelope>
- Get the Application and note the applicationID (https://localhost:9443/services/IdentityApplicationManagementService?wsdl)
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd">
<soap:Header/>
<soap:Body>
<xsd:getApplication>
<!--Optional:-->
<xsd:applicationName>sample</xsd:applicationName>
</xsd:getApplication>
</soap:Body>
</soap:Envelope>
Note : <ax2171:applicationID>15</ax2171:applicationID>
- Update
inboundAuthenticationConfig
of the application created in step 3 (https://localhost:9443/services/IdentityApplicationManagementService?wsdl) Use:
- applicationID found in step 4
- oauthConsumerKey found in step 2 as the inboundAuthKey
- oauthConsumerSecret found in step 2 as oauthConsumerSecret property value
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://model.common.application.identity.carbon.wso2.org/xsd" xmlns:xsd2="http://script.model.common.application.identity.carbon.wso2.org/xsd">
<soap:Header/>
<soap:Body>
<xsd:updateApplication>
<xsd:serviceProvider>
<xsd1:applicationID>15</xsd1:applicationID>
<xsd1:applicationName>sample</xsd1:applicationName>
<xsd1:inboundAuthenticationConfig>
<xsd1:inboundAuthenticationRequestConfigs>
<xsd1:inboundAuthKey>kCVqngLf6fs0lQeXZwxL16ArRrAa</xsd1:inboundAuthKey>
<xsd1:inboundAuthType>oauth2</xsd1:inboundAuthType>
<xsd1:properties>
<xsd1:name>oauthConsumerSecret</xsd1:name>
<xsd1:value>jauiJEAICB7Klk5us6FMSWjeEJoa</xsd1:value>
</xsd1:properties>
</xsd1:inboundAuthenticationRequestConfigs>
</xsd1:inboundAuthenticationConfig>
</xsd:serviceProvider>
</xsd:updateApplication>
</soap:Body>
</soap:Envelope>

Anuradha Karunarathna
- 2,717
- 2
- 9
- 17
-
i used the above soap req to create oauth config its created successfully but unable to see on wso2is v5.7 console means on ui under service provider – Vijay Yadav Jun 21 '21 at 16:11
-
Did you follow all 5 steps? The first step is to create oauth config only. Just creating that doesn't list under service providers in the management console. Whatever service provider you create in step 3 will be listed under service provider. Step 5 is to attach oauth configs to the created service provider – Anuradha Karunarathna Jun 21 '21 at 16:20
-
What i m doing - first create service provider - then create oauth configuration with service provider then and go to wso2 console to see the oauth configuration data but there is not data displaying over there – Vijay Yadav Jun 21 '21 at 17:16
-