0
votes

I have a simple node application written using (simple-oauth2) http://lelylan.github.io/simple-oauth2/#client-credentials-flow

Sample here https://github.com/lelylan/simple-oauth2/blob/master/example/index.js

I use the below config.

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

I get the below response from /authorize { error_description: 'The authenticated client is not authorized to use this authorization grant type', error: 'unauthorized_client' }

In the logs I get the below

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 : [email protected], 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 : [email protected], 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}

Please let me know what is wrong

Thanks Mahesh

1

1 Answers

0
votes

My Bad, after enabling the 'code' in store things worked

enter image description here