diff --git a/web/server/codechecker_server/api/authentication.py b/web/server/codechecker_server/api/authentication.py index a8f195a564..a256c97b0b 100644 --- a/web/server/codechecker_server/api/authentication.py +++ b/web/server/codechecker_server/api/authentication.py @@ -222,11 +222,20 @@ def createLink(self, provider): code_challenge_method='S256' ) - # Create authorization URL - url, state = session.create_authorization_url( - authorization_uri, - state=stored_state, - code_verifier=pkce_verifier + if provider == "google": + # each provider has different requirements for requesting refresh token + url, state = session.create_authorization_url( + url = authorization_uri, + state=stored_state, + code_verifier=pkce_verifier, + access_type='offline', + prompt='consent' + ) + else: + url, state = session.create_authorization_url( + authorization_uri, + state=stored_state, + code_verifier=pkce_verifier ) # inserting data in database self.insertDataOauth(state=state,