I want to read user's email directory people. In order to do that, I need to ask the user for permission.
I was using Firebase for auth, but due to this, I had to migrate to Google Identity Services SDK, because Firebase doesn't support any way how to refresh an expired access token.
Currently, I'm using auth code flow together with incremental auth, because I don't want to beg for user consent right after registration.
PROBLEM
The user is already signed in, so I want to ask just for user consent. To do so, I use this code with prompt: 'consent'.
const authorizationUrl = oauth2Client.generateAuthUrl({
access_type: 'offline', //gets refresh token
scope: scope,
include_granted_scopes: true,
login_hint: email, // also tried sub from id_token, but same result
prompt: 'consent'
});
When I redirect user to authorizationUrl, account chooser screen is shown, afterwards, a user consent screen is shown. Am I missing something? When a user is signed in I don't want to have the ability to change account in that part of the app.
Last question. I'm wondering if it's possible to use firebase auth for sign-in/sign-out and google GSI just for incremental auth (asking for permission)?