XeroAPI / xoauth

A CLI tool for obtaining JWTs from OpenId Connect providers
MIT License
49 stars 16 forks source link

Unable to get grant type 'client_credentials' working #9

Open dvruette opened 4 years ago

dvruette commented 4 years ago

Upon creating a connection with grant type client_credentials I am unable to connect to it and I get the following output in the console:

Requesting OIDC metadata from https://identity.xero.com/.well-known/openid-configuration
Received OIDC metadata for authority: https://identity.xero.com
Requesting token with client credentials grant: https://identity.xero.com/connect/token
received error from code endpoint. statusCode: 400, body: {
 "error": "unauthorized_client"
}

The credentials I've entered are from the /myapps/details page and work when using grant type authorization_code.

Is there a way to authorize this client or another way to generate credentials that work with grant type client_credentials? Thanks for pointing me in the right direction.

AndreJoaquim commented 4 years ago

Hello! I'm getting the same issue as above. Can you provide with any input on this?

PaulVidler commented 4 years ago

Agreed. Same issue.

ckapatch commented 3 years ago

Looks like it isn't supported which is really disappointing since it's what we'd need to fully move from the previous implementation to the new one. I asked this through the help portal and the official "solution" is to basically save the access and refresh token of a valid user and use that.

https://developer.xero.com/documentation/guides/how-to-guides/machine-2-machine/#maintaining-an-offline-connection