soapui - 如何使用soap请求在serviceprovider中添加oauth/openID配置
问题描述
我想在 wso2 的服务提供者下添加 oauth/openID 连接配置。我将如何使用肥皂请求添加这些配置。请帮助我。
解决方案
- 注册 OAuth 应用数据(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>
- 按名称获取 OAuth 应用程序数据 (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>
注意:oauthConsumerKey
并oauthConsumerSecret
从响应中
<ax2402:oauthConsumerKey>kCVqngLf6fs0lQeXZwxL16ArRrAa</ax2402:oauthConsumerKey>
<ax2402:oauthConsumerSecret>jauiJEAICB7Klk5us6FMSWjeEJoa</ax2402:oauthConsumerSecret>
- 创建一个应用程序(服务提供者)(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>
- 获取 Application 并记下 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>
笔记 : <ax2171:applicationID>15</ax2171:applicationID>
- 更新
inboundAuthenticationConfig
步骤 3 中创建的应用程序 (https://localhost:9443/services/IdentityApplicationManagementService?wsdl) 使用:
- 在步骤 4 中找到的 applicationID
- 在步骤 2 中找到的 oauthConsumerKey 作为 inboundAuthKey
- 在步骤 2 中找到 oauthConsumerSecret 作为 oauthConsumerSecret 属性值
<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>
推荐阅读
- python-3.x - Python多处理数组和SharedMemory之间的区别?
- sequelize.js - Sequelize - 当你有值时如何从相关表中获取 id
- visual-studio-2019 - 复杂的自定义用户管理标识 asp.net core 3.1 带断点运行,不带断点不运行
- django - 将表单数据从 FormView 保存到会话
- python - 无法将两个字典合并为一个字典
- elixir - 长生不老药句法词后跟冒号和波浪形箭头等
- responsive-design - 在给定最小/理想/最大字体大小和最小/当前/最大屏幕宽度的情况下,找到固定字体大小的比例/比率
- java - intellij中奇怪的特殊字符处理
- .net-core - .Net Core 3.5 Blazor 可选的 int 路由参数
- arrays - C - 为什么“地址”运算符返回变量的整数值,而不管变量类型如何?