Wso2 使用Oauth2和SOAP创建服务提供程序
我正在尝试通过SOAP创建SP。创建SP的调用是正确的,之后我尝试通过指定oauthConsumerKey和OAuthConsumerCret的SOAP配置Oauth2,如下所示Wso2 使用Oauth2和SOAP创建服务提供程序,wso2,wso2is,wso2carbon,Wso2,Wso2is,Wso2carbon,我正在尝试通过SOAP创建SP。创建SP的调用是正确的,之后我尝试通过指定oauthConsumerKey和OAuthConsumerCret的SOAP配置Oauth2,如下所示 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http
<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>
<xsd:application>
<xsd1:OAuthVersion>OAuth-2.0</xsd1:OAuthVersion>
<xsd1:applicationAccessTokenExpiryTime>3600</xsd1:applicationAccessTokenExpiryTime>
<xsd1:applicationName>test</xsd1:applicationName>
<xsd1:callbackUrl>regexp=(.*)/login/oauth2/code/wso2</xsd1:callbackUrl>
<xsd1:grantTypes>refresh_token urn:ietf:params:oauth:grant-type:saml2-bearer implicit password client_credentials iwa:ntlm authorization_code urn:ietf:params:oauth:grant-type:uma-ticket urn:ietf:params:oauth:grant-type:jwt-bearer</xsd1:grantTypes>
<xsd1:oauthConsumerKey>gVWBVK0pdX4pg2Yk3fFbBjKe1aUa</xsd1:oauthConsumerKey>
<xsd1:oauthConsumerSecret>CbfGJXhTYvb3i1BAfu5ijgUSXXYa</xsd1:oauthConsumerSecret>
<xsd1:pkceMandatory>false</xsd1:pkceMandatory>
<xsd1:pkceSupportPlain>true</xsd1:pkceSupportPlain>
<xsd1:refreshTokenExpiryTime>86400</xsd1:refreshTokenExpiryTime>
<xsd1:userAccessTokenExpiryTime>3600</xsd1:userAccessTokenExpiryTime>
</xsd:application>
</xsd:registerOAuthApplicationData>
</soapenv:Body>
</soapenv:Envelope>
OAuth-2.0
3600
测试
regexp=(.*)/login/oauth2/code/wso2
刷新令牌urn:ietf:params:oauth:grant类型:saml2承载隐式密码客户端\u凭证iwa:ntlm授权\u代码urn:ietf:params:oauth:grant类型:uma票证urn:ietf:params:oauth:grant类型:jwt承载
gVWBVK0pdX4pg2Yk3fFbBjKe1aUa
CbfGJXhTYvb3i1BAfu5ijgUSXXYa
假的
真的
86400
3600
但在db中,我发现了不同的键,oauth版本,callbackUrl和grant_类型,如屏幕所附
我做错什么了吗
当我运行SOAP时,响应是
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:registerOAuthConsumerResponse xmlns:ns="http://org.apache.axis2/xsd" xmlns:ax2408="http://dto.oauth.identity.carbon.wso2.org/xsd" xmlns:ax2404="http://oauth.identity.carbon.wso2.org/xsd" xmlns:ax2405="http://base.identity.carbon.wso2.org/xsd"><ns:return>BE2JqA9lOZQKSkMvo4diNy2QHb0a</ns:return><ns:return>7xjxUrbWOztADfODEcvEbn8NeuEa</ns:return></ns:registerOAuthConsumerResponse></soapenv:Body></soapenv:Envelope>
BE2JQA9LOZQKSKMVO4INY2QHB0A7XJXURBWOZTADFODECVEBN8NEUEA
从评论中获取答案:
这意味着您执行了一个不正确的SOAP请求。从注释中获取答案:
这意味着您执行了一个错误的SOAP请求。请您提及IS版本和您用于IS的数据库类型好吗?我使用的wso2 IS 5.10和postgres数据库希望您在复制粘贴时错过了起始标记。除此之外,这个SOAP请求主体是正确的。我尝试了完全相同的请求主体,效果很好。我想你看到的是表格中的另一个条目。你能刷新idn_oauth_consumer_apps表并在SOAP调用更新answare后查看条目吗。。。这对我不起作用me@Jalisse给定的SOAP响应不是上述SOAP请求(RegisterAuthApplicationData)的预期响应。对于上述soap请求,您应该获得RegisterAuthApplicationDataResponse。如果只执行RegisterAuthConsumer SOAP请求,则会得到RegisterAuthConsumerResponse。您正在查看的数据库条目是由RegisterAuthConsumer请求生成的。似乎您使用的是不同的soap请求。请您提及IS版本和用于IS的数据库类型好吗?我使用的是wso2 IS 5.10和postgres数据库,希望您在复制粘贴时错过了起始标记。除此之外,这个SOAP请求主体是正确的。我尝试了完全相同的请求主体,效果很好。我想你看到的是表格中的另一个条目。你能刷新idn_oauth_consumer_apps表并在SOAP调用更新answare后查看条目吗。。。这对我不起作用me@Jalisse给定的SOAP响应不是上述SOAP请求(RegisterAuthApplicationData)的预期响应。对于上述soap请求,您应该获得RegisterAuthApplicationDataResponse。如果只执行RegisterAuthConsumer SOAP请求,则会得到RegisterAuthConsumerResponse。您正在查看的数据库条目是由RegisterAuthConsumer请求生成的。似乎您正在使用不同的soap请求