My Business
5.1K members online now
5.1K members online now
For developers who are using the Google My Business API to manage locations
Guide Me
star_border
Reply

Authentication has failed: invalid_clientUnauthorized error

[ Edited ]
Not applicable
# 1
Not applicable

Hi API Team,

 

I’m running into an issue when attempting to connect via Web connection on oauth2 with the approved username. The API has already been enabled in developer console and client secrets are accurate.

 

Following the oauth2 authentication process, I'm able to complete the authentication flow via web successfully, but receive a failure message shortly after saying "Authentication has failed, invalid_clientUnauthorized"

 

 

I've made attempts using different API versions to no avail.

 

Any advice would help!


Thanks,

1 Expert replyverified_user

Authentication has failed: invalid_clientUnauthorized error

Not applicable
# 2
Not applicable

Bumping to see if anyone would be able to assist.

 

Re: Authentication has failed: invalid_clientUnauthorized error

Google Employee
# 3
Google Employee

Hi,

 

It looks like the error you experienced may be related to OAuth 2.0 Authorization using the OAuth 2.0 client ID. Can you verify that the access token is being retrieved correctly? Note that, when using the OAuth 2.0 client ID for authorization, you should store the refresh token for future use and use the access token to access the API. Once the access token expires, the application should use the refresh token to obtain a new one. This way, your application will always be able to request a new access token when necessary. This process requires a user to manually authorize the application only once.

 

Please follow the Make a simple HTTP request step thoroughly on the Get Started page of the documentation website to learn how to use the OAuth 2.0 Playground to experiment with the Google My Business API.  

 

Note that you should write your code to anticipate the possibility that a granted token might no longer work for various reasons, and obtain a new token when the existing token is deemed invalid.

 

Thanks,

The Google My Business API team