diff --git a/adal/token_request.py b/adal/token_request.py index e97e764b..dd6f4501 100644 --- a/adal/token_request.py +++ b/adal/token_request.py @@ -319,12 +319,6 @@ 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: @@ -332,7 +326,7 @@ def get_token_with_authorization_code(self, authorization_code, client_secret, c 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):