Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uber api access_token goes bad and can not be refreshed

It is mentioned in oauth documentation at https://developer.uber.com/v1/auth/ that access token remains valid for 30 days. But I have started getting invalid credential error within a week. The exact error I am getting is:-

{"message":"Invalid OAuth 2.0 credentials provided.","code":"unauthorized"}

Trying refresh token after this error gives invalid grant error whereas 'refresh_token' is valid grant type.

{"error": "invalid_grant"}

Anyone facing similar issues?

like image 458
ninja Avatar asked Oct 19 '22 14:10

ninja


1 Answers

If your client credentials are used to get another access token, that will invalidate former access tokens associated with that user.

When an access token expires, you must obtain a new access token. Use the refresh token to get a new access token without prompting a user to login and grant permission again. The refresh token itself is not a valid token to access API endpoints - it is just a code you keep to exchange for a new access token when yours expires. This is described in Step Five: Refreshing Tokens in Uber's Authentication Guide.

like image 105
Christine Kim Avatar answered Oct 22 '22 19:10

Christine Kim