简体   繁体   English

验证WSO2中的OAuth2令牌

[英]Validating OAuth2 token in WSO2

I want to use WSO2 for sso. 我想将WSO2用于sso。 When i'm going to validate token code in SoapUI i'm facing with Invalid access token error. 当我要在SoapUI中验证令牌代码时,我面临着无效的访问令牌错误。 I registered and i'm redirect to this URL: 我已经注册,并重定向到该URL:

http://MyRedirectPage/?code=63873a38-40c6-3240-850c-a50bf7ad8883&session_state=7877d1d733d534206c4247b31d63d95bd3e3dda9d77cd819b4d81e7eeabceb45.Xq6OQiFUARHShBxUZtFHTQ http:// MyRedirectPage /?code = 63873a38-40c6-3240-850c-a50bf7ad8883&session_state = 7877d1d733d534206c4247b31d63d95bd3e3dda9d77cd819b4d81e7eeabceb45.Xq6OQiFUARHShBxUZtFHTQ

I'm using code parameter for validation: 63873a38-40c6-3240-850c-a50bf7ad8883 我正在使用代码参数进行验证:63873a38-40c6-3240-850c-a50bf7ad8883

Here is my code in SoapUI: 这是我在SoapUI中的代码:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://org.apache.axis2/xsd" xmlns:xsd1="http://dto.oauth2.identity.carbon.wso2.org/xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <xsd:validate>
         <!--Optional:-->
         <xsd:validationReqDTO>
            <!--Optional:-->
            <xsd1:accessToken>
               <!--Optional:-->
               <xsd1:identifier>63873a38-40c6-3240-850c-a50bf7ad8883</xsd1:identifier>
               <!--Optional:-->
               <xsd1:tokenType>Bearer</xsd1:tokenType>
            </xsd1:accessToken>
            <!--Zero or more repetitions:-->
            <xsd1:context>
               <!--Optional:-->
               <xsd1:key>?</xsd1:key>
               <!--Optional:-->
               <xsd1:value>?</xsd1:value>
            </xsd1:context>
            <!--Zero or more repetitions:-->
            <xsd1:requiredClaimURIs>?</xsd1:requiredClaimURIs>
         </xsd:validationReqDTO>
      </xsd:validate>
   </soapenv:Body>
</soapenv:Envelope>

And here is the result: 结果如下:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:validateResponse xmlns:ns="http://org.apache.axis2/xsd">
         <ns:return xsi:type="ax2395:OAuth2TokenValidationResponseDTO" xmlns:ax2395="http://dto.oauth2.identity.carbon.wso2.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ax2395:authorizationContextToken xsi:nil="true"/>
            <ax2395:authorizedUser xsi:nil="true"/>
            <ax2395:errorMsg>Invalid access token</ax2395:errorMsg>
            <ax2395:expiryTime>0</ax2395:expiryTime>
            <ax2395:scope xsi:nil="true"/>
            <ax2395:valid>false</ax2395:valid>
         </ns:return>
      </ns:validateResponse>
   </soapenv:Body>
</soapenv:Envelope>

Would you please tell me what is wrong? 你能告诉我出什么事了吗?

It seems you're trying to validate the authorization code. 看来您正在尝试验证授权码。 (Why are you doing that?) This service is only for validating access tokens. (为什么要这样做?)此服务仅用于验证访问令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM