Search code examples
oauth-2.0actions-on-google

Google action & Auth0 account linking Token expires for every 24hours


I am developing a Google action and added account linking

In the linked image you can see the settings I did in Action console->Account linking.

Action console Account linking

In AuthO Applications added all fields necessary, JWT Expiration set to 604800 also in APIs setting I have updated Token Expiration (Seconds) to Token Expiration (Seconds)

Auth0 application setting

Auth0 api settings

Account linking works perfectly but after 24 hours, my Google action prompts the user to ‘link the account again’, Even though I changed the JWT expiration to 7 days(604800 seconds) and Token Expiration to 7 days, I don’t know why action asks the user to link there account again after 24 hours. Is there anything I left out.

Kindly help me in this regard as it is very important me to publish action and running over my deadline


Solution

  • While the Assistant not accepting the long Access Token, the stranger thing is that it should be using a Refresh Token to get a new Access Token instead of requiring the user to re-link the accounts.

    Assuming you're using the auth token flow (and it looks like you are), Auth0 will send a Refresh Token if you request the offline_access scope.

    It looks like you're requesting _offlineaccess, which isn't the right scope. Changing this to the correct string (or adding it) should give the Assistant a Refresh Token, so it won't re-prompt the user unless the token is revoked.