WSO2 IS OAuth2 资源所有者密码 - 获取访问令牌
WSO2 IS OAuth2 Resource owner password - getting access token
我正在尝试从 WSO2 身份服务器获取 oauth 令牌:
curl -v -X POST -u "GIHAZzRMGNnm3X8XGMwZVoCe2hUa:Uf4wAlQWufaTk320Se2emnJVgvca" -H "Content-Type: application/x-www-form-urlencoded" -k -d "grant_type=password&username=myemail@shan.com&password=mypwd" https://localhost:9449/oauth2/token
响应是
{"error":"server_error","error_description":"Error when issuing the access token"}
服务器异常
TID[-1234] [IS] [2015-08-08 11:53:15,692] ERROR {org.wso2.carbon.identity.oauth2.OAuth2Service} - Error when issuing the access token. org.wso2.carbon.identity.oauth2.token.handlers.grant.AbstractAuthorizationGrantHandler.issue(AbstractAuthorizationGrantHandler.java:207) org.wso2.carbon.identity.oauth2.token.AccessTokenIssuer.issue(AccessTokenIssuer.java:206) org.wso2.carbon.identity.oauth2.OAuth2Service.issueAccessToken(OAuth2Service.java:177) org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint.getAccessToken(OAuth2TokenEndpoint.java:230) org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint.issueAccessToken(OAuth2TokenEndpoint.java:108) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
在 IS 中,我启用了所有授权类型,隐式和客户端凭据经过测试可以正常工作。此错误仅发生在 'password' 授权类型。有人可以让我知道我做错了什么吗?
请使用此格式生成密码授予类型的令牌。
curl -k -d "grant_type=password&username=<username>&password=<password>" -H "Authorization: Basic <Base64Encoded(Consumer key:consumer secret)>, Content-Type: application/x-www-form-urlencoded" https://<host>:8243/token
我正在尝试从 WSO2 身份服务器获取 oauth 令牌:
curl -v -X POST -u "GIHAZzRMGNnm3X8XGMwZVoCe2hUa:Uf4wAlQWufaTk320Se2emnJVgvca" -H "Content-Type: application/x-www-form-urlencoded" -k -d "grant_type=password&username=myemail@shan.com&password=mypwd" https://localhost:9449/oauth2/token
响应是 {"error":"server_error","error_description":"Error when issuing the access token"}
服务器异常
TID[-1234] [IS] [2015-08-08 11:53:15,692] ERROR {org.wso2.carbon.identity.oauth2.OAuth2Service} - Error when issuing the access token. org.wso2.carbon.identity.oauth2.token.handlers.grant.AbstractAuthorizationGrantHandler.issue(AbstractAuthorizationGrantHandler.java:207) org.wso2.carbon.identity.oauth2.token.AccessTokenIssuer.issue(AccessTokenIssuer.java:206) org.wso2.carbon.identity.oauth2.OAuth2Service.issueAccessToken(OAuth2Service.java:177) org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint.getAccessToken(OAuth2TokenEndpoint.java:230) org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint.issueAccessToken(OAuth2TokenEndpoint.java:108) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
在 IS 中,我启用了所有授权类型,隐式和客户端凭据经过测试可以正常工作。此错误仅发生在 'password' 授权类型。有人可以让我知道我做错了什么吗?
请使用此格式生成密码授予类型的令牌。
curl -k -d "grant_type=password&username=<username>&password=<password>" -H "Authorization: Basic <Base64Encoded(Consumer key:consumer secret)>, Content-Type: application/x-www-form-urlencoded" https://<host>:8243/token