Google OAuth - Access token cannot be refreshed

I am trying to create a custom app to sync certain data between freshservice and Google. I have created a simple app that is a cut and paste from the OAuth example in the documentation. After authorizing with Google successfully, I get an error message that says “Access token cannot be refreshed”

I assume that most of the OAuth stuff is handled server-side, so how should I begin troubleshooting this?

1 Like

@meisan Could you please share your oauth_config.json?

Note: Hide the sensitive data.

I had to remove the redirect URIs and javascript origins due to the link limits on the forum, but I have verified those are working as expected.

{
“client_id”: “notarealid”,
“client_secret”: “supersecret”,
“authorize_url”: “https://accounts.google.com/o/oauth2/auth”,
“token_url”: “https://oauth2.googleapis.com/token”,
“options”: {
“project_id”: “my-project-name-here”,
“auth_provider_x509_cert_url”: “https://www.googleapis.com/oauth2/v1/certs”,
“redirect_uris”: [
// removed due to link limits
],
“javascript_origins”: [
// removed due to link limits
],
“scope”: “https://www.googleapis.com/auth/admin.directory.device.chromeos
},
“token_type”: “account”
}

1 Like

@meisan I was able to successfully get access token using the below

{
"client_id": "enteryourclientid",
"client_secret": "enteryourclientsecret",
"authorize_url": "https://accounts.google.com/o/oauth2/auth",
"token_url": "https://oauth2.googleapis.com/token",
"options": {
	"scope": "https://mail.google.com/"
},
"token_type": "account"
} 

In your google project, add the below redirect URIs

http://localhost:10001/auth/callback?callback=http://localhost:10001/custom_configs?product= freshservice&product= freshservice

https://oauth.freshdev.io/auth/callback
1 Like