Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
client_secret=self._authentication_configuration.client_secret)
if self._authentication_configuration.refresh_token is None:
access_token_request.scope = scope
else:
access_token_request.refresh_token = (
self._authentication_configuration.refresh_token)
lwa_response = self._generate_access_token(
access_token_request=access_token_request)
if lwa_response is None or lwa_response.expires_in is None:
raise ValueError("Invalid response from LWA Client generate "
"access token call")
access_token = AccessToken(
token=lwa_response.access_token,
expiry=local_now + timedelta(seconds=lwa_response.expires_in)
)
self._scoped_token_cache[cache_key] = access_token
return access_token.token