Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

fix an incorrect cache operation on authorization code flow #161

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions adal/token_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,14 @@ def get_token_with_client_credentials(self, client_secret):
def get_token_with_authorization_code(self, authorization_code, client_secret, code_verifier):

self._log.info("Getting token with auth code.")
try:
token = self._find_token_from_cache()
if token:
return token
except AdalError:
self._log.exception('Attempt to look for token in cache resulted in Error')
oauth_parameters = self._create_oauth_parameters(OAUTH2_GRANT_TYPE.AUTHORIZATION_CODE)
oauth_parameters[OAUTH2_PARAMETERS.CODE] = authorization_code
if client_secret is not None:
oauth_parameters[OAUTH2_PARAMETERS.CLIENT_SECRET] = client_secret
if code_verifier is not None:
oauth_parameters[OAUTH2_PARAMETERS.CODE_VERIFIER] = code_verifier
token = self._oauth_get_token(oauth_parameters)
self._cache_driver.add(token)
self._add_token_into_cache(token)
return token

def _get_token_with_refresh_token(self, refresh_token, resource, client_secret):
Expand Down