OAuth2 无法获取授权码。总是得到 'The authenticated client is not authorized to use this authorization grant type'

OAuth2 unable to get Auth code. Always get 'The authenticated client is not authorized to use this authorization grant type'

我有一个使用 (simple-oauth2) 编写的简单节点应用程序 http://lelylan.github.io/simple-oauth2/#client-credentials-flow

示例在这里 https://github.com/lelylan/simple-oauth2/blob/master/example/index.js

我使用下面的配置。

const credentials = {
  client: {
    id: 'XXXXXXXX',
    secret: 'YYYYYYYYYY'
  },
  auth: {
    tokenHost: 'https://localhost:8243',
    tokenPath: '/token',
    authorizeHost: 'https://localhost:8243',
    authorizePath: '/authorize' 
  }
};

我从 /authorize 得到以下回复 { error_description: 'The authenticated client is not authorized to use this authorization grant type', 错误:'unauthorized_client'}

在日志中我得到以下内容

TID: [-1234] [] [2018-05-09 17:03:49,697] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.AbstractResponseTypeHandler} -  Unsupported Grant Type : authorization_code for client id : 8_90GgNFMBY7zvZqEeTeKqaLgC0a {org.wso2.carbon.identity.oauth2.authz.handlers.AbstractResponseTypeHandler}
TID: [-1234] [] [2018-05-09 17:03:49,698] DEBUG {org.wso2.carbon.identity.oauth2.authz.AuthorizationHandlerManager} -  Client validation failed for user : admin@carbon.super, for client : 8_90GgNFMBY7zvZqEeTeKqaLgC0a {org.wso2.carbon.identity.oauth2.authz.AuthorizationHandlerManager}
TID: [-1234] [] [2018-05-09 17:03:49,699] DEBUG {org.wso2.carbon.identity.oauth2.authz.AuthorizationHandlerManager} -  Error response received for authorization request by user : admin@carbon.super, client : 8_90GgNFMBY7zvZqEeTeKqaLgC0a, scope : PRODUCTION {org.wso2.carbon.identity.oauth2.authz.AuthorizationHandlerManager}
TID: [-1234] [] [2018-05-09 17:03:49,700] DEBUG {org.wso2.carbon.webapp.mgt.loader.CarbonWebappClassLoader} -  loadClass(org.apache.oltu.oauth2.as.response.OAuthASResponse, false) {org.wso2.carbon.webapp.mgt.loader.CarbonWebappClassLoader}

有什么问题请告诉我

谢谢 马赫什

糟糕,在商店中启用 'code' 后一切正常