Description
I have encountered an issue with the OAuth2 library in Google Apps Script, specifically related to the persistence of the authentication session across different tabs or browser instances. When using the provided authentication flow with Auth0, I noticed that after logging in through my Gmail add-on, the authentication session does not persist when opening a new tab or browser instance.
Expected Behavior:
When logging in to app without the add-on, the authentication session remains active, and opening a new tab or browser instance does not require reauthentication.
The same behavior is expected when logging in through the Gmail add-on, where the authentication session should persist across tabs or browser instances.
Observed Behavior:
After logging in through the Gmail add-on, opening a new tab or browser instance prompts me to authenticate again when accessing mywebsite.com.
This behavior is inconsistent with the expected behavior observed when logging in without the add-on.
Code sample:
var scopes = ['openid', 'profile', 'email', 'offline_access']
function getService() {
return OAuth2.createService('auth')
.setAuthorizationBaseUrl('https://{auth0 custom domain}/authorize')
.setTokenUrl('https://{auth0 custom domain}/oauth/token')
.setClientId(MY_CLIENT_ID)
.setScope(scopes.join(' '))
.setCallbackFunction('authCallback')
.setCache(CacheService.getUserCache())
.setPropertyStore(PropertiesService.getUserProperties())
.setParam('audience', MY_AUDIENCE)
.setParam('response_type', 'code')
.setParam('response_mode', 'query')
.setParam('prompt', 'login')
}
- Is it possible to persist the authentication session across tabs or browser instances when using the OAuth2 library in Google Apps Script with Auth0?
- Does achieving session persistence require specific configuration settings within Auth0?
- Are Auth0 session cookies utilized to maintain the authentication session across different tabs or browser instances?
Thanks in advance