-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
accessType=offline & approvalPrompt=force doesn't work in Chrome #4
Comments
Any updates on this? I also need the ability to re-generate my refresh token. |
Amazing, thanks so much @sunknudsen, problem fixed 👍 |
This doesn't work for me. Here is my config in passport. Tried with
|
I also get the same issue as @mandeepm91 |
+1 @haydarai @mandeepm91 |
@natanbr |
@cyan198 can you please share the options and the callback signature you are using?
|
The only different is in the scope, mine looks like this Of course the adwords is specific to my need. In my case I don't need any info other than email from the account. What error do u get? |
I didn't get an error, just undefined refresh token.
with the connection URL, not as part of the strategy |
Glad to hear! |
Took me quite a long time and spanned multiple discussions here; as of today the following do retrieve the refresh token :
And the router :
|
This works but giving me error on typescript. looks like passport strategy constructor type has not type definition for these two. |
@ghulamhaider1 did you find a way to make it work with the typescript strategy constructor? |
I know this is a year old but you could extend interface ExtendedAuthenticateOptions extends AuthenticateOptions {
accessType?: string;
authType?: string;
includeGrantedScopes?: boolean;
}
const authOptions: ExtendedAuthenticateOptions = {
authType: 'rerequest',
accessType: 'offline',
prompt: 'consent',
includeGrantedScopes: true,
scope: ['email', 'profile', 'openid']
};
const authGoogle = async (req: Request, res: Response): Promise<void> => {
await passport.authenticate('google', authOptions)(req, res);
}; |
i am able to get the refresh token the refresh token is showing invalid when in try to get id_token from google apis using the refresh token passport.use(new GoogleStarategy({
clientID: process.env.GOOGLE_AUTH_CLIENTID,
clientSecret: process.env.GOOGLE_AUTH_CLIENT_SECRET,
callbackURL: uris.GOOGLE_CALLBACK_URL,
passReqToCallback: true
}, async (req,accessToken, refreshToken, params, profile, cb) => {
return cb(null, result)
}));
authRoutes.route('/login/google').get(passport.authenticate('google', {
scope: [" https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email"],
approvalPrompt:
'force',accessType: 'offline'})); the refresh token i have {
refreshToken: '1//0gdDoOs3m76H4CgYIARAAGBASNwF-L9Ireg13JT11xNWBNd1OLif5FAks9o36qZ50JSqCpBBIL7mOqk4btwgoqRa7mBmMtPrTAFQ'
} how to get the id_token using refresh token after token expiry |
When I call passport.authenticate for google, configured with the passport-google-oauth2 config, the Google OAuth confirmation screen is not forced in Chrome. It is forced in Safari. This is required to get the google refresh token on a users 2nd + time authenticating. Wondering if there is something we can do within the scope of this library to help force the prompt. Thanks!
The text was updated successfully, but these errors were encountered: