Oauth 2.0 服务器使用WSO2 Identity Server获取具有访问令牌的刷新令牌

Oauth 2.0 服务器使用WSO2 Identity Server获取具有访问令牌的刷新令牌,oauth-2.0,wso2,wso2is,Oauth 2.0,Wso2,Wso2is,我正在打以下电话: curl -k -d "grant_type=client_credentials" -H "Authorization: Basic <Encoded ID & Secret>)" https://MyIDPUrl/token 这一切似乎都很好,只是我没有得到一个刷新令牌。我尝试将&scope=openid添加到url中,这为响应添加了一个id\u标记,但没有刷新标记 如何使用WSO2获取刷新令牌?规范规定,客户端\u凭据授予类型不返回刷新令牌 这是有

我正在打以下电话:

curl -k -d "grant_type=client_credentials" -H "Authorization: Basic <Encoded ID & Secret>)" https://MyIDPUrl/token
这一切似乎都很好,只是我没有得到一个刷新令牌。我尝试将&scope=openid添加到url中,这为响应添加了一个id\u标记,但没有刷新标记


如何使用WSO2获取刷新令牌?

规范规定,客户端\u凭据授予类型不返回刷新令牌

这是有意义的,因为刷新令牌的目的是不打扰用户再次登录。但是有了client_凭据,您就可以获得另一个访问令牌


是对于客户端凭据授予类型,不使用刷新令牌。但是,如果您想要获取刷新令牌,您可以通过更改identity.xml中的配置来获取刷新令牌,该配置位于下一节的\u Home/repository/conf/identity中

        <SupportedGrantType>
            <GrantTypeName>client_credentials</GrantTypeName>
            <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.ClientCredentialsGrantHandler</GrantTypeHandlerImplClass>
            <IsRefreshTokenAllowed>false</IsRefreshTokenAllowed>
            <IdTokenAllowed>false</IdTokenAllowed>
        </SupportedGrantType>
如果将IsRefreshTokenAllowed的值更改为true,则应返回刷新令牌。更改配置值后,需要重新启动服务器。默认情况下,它为false,因为此授予类型中没有用户参与。刷新令牌无效

        <SupportedGrantType>
            <GrantTypeName>client_credentials</GrantTypeName>
            <GrantTypeHandlerImplClass>org.wso2.carbon.identity.oauth2.token.handlers.grant.ClientCredentialsGrantHandler</GrantTypeHandlerImplClass>
            <IsRefreshTokenAllowed>false</IsRefreshTokenAllowed>
            <IdTokenAllowed>false</IdTokenAllowed>
        </SupportedGrantType>