diff --git a/web/server/codechecker_server/api/authentication.py b/web/server/codechecker_server/api/authentication.py index 2186e37941..4a462264da 100644 --- a/web/server/codechecker_server/api/authentication.py +++ b/web/server/codechecker_server/api/authentication.py @@ -266,6 +266,7 @@ def createLink(self, provider): "State code insertion failed.") LOG.debug(f"State {state} inserted successfully with ID {state_id}") + print(url + "&state_id=" + str(state_id)) # added here re1move return url + "&state_id=" + str(state_id) @timeit diff --git a/web/tests/functional/authentication/oauth_server.py b/web/tests/functional/authentication/oauth_server.py index e008256c78..49ef9f562b 100644 --- a/web/tests/functional/authentication/oauth_server.py +++ b/web/tests/functional/authentication/oauth_server.py @@ -87,7 +87,8 @@ def login_tester(self): if query_result: state = params['state'] code = query_result['code'] - return self.show_json({"code": code, "state": state}) + state_id = params['state_id'] # added here re1move + return self.show_json({"code": code, "state": state, "state_id": state_id}) # added here re1move return self.show_rejection("Invalid credentials") except IndexError: return self.show_rejection("Invalid query parameters") diff --git a/web/tests/functional/authentication/test_authentication.py b/web/tests/functional/authentication/test_authentication.py index 60718d02a0..79e07a4817 100644 --- a/web/tests/functional/authentication/test_authentication.py +++ b/web/tests/functional/authentication/test_authentication.py @@ -198,9 +198,9 @@ def try_login(self, provider, username, password): raise RequestFailed(data['error']) link = link.split('?')[0] - code, state = data['code'], data['state'] - auth_string = f"{link}?code={code}&state={state}" - + code, state, state_id = data['code'], data['state'], data['state_id'] # added here re1move + auth_string = f"{link}?code={code}&state={state}&state_id={state_id}" # added here re1move + #login?code=b297074a409d34818198&state=msuPS01qPAQrTsxYKMeVpDlG0hd3uc&state_id=4 self.session_token = auth_client.performLogin( "oauth", provider + "@" + auth_string)