How to use the ask-sdk-model.ask_sdk_model.services.lwa.access_token.AccessToken function in ask-sdk-model

To help you get started, we’ve selected a few ask-sdk-model examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexa / alexa-apis-for-python / ask-sdk-model / ask_sdk_model / services / lwa / lwa_client.py View on Github external
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

ask-sdk-model

The ASK SDK Model package provides model definitions, for building Alexa Skills.

Apache-2.0
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis

Popular ask-sdk-model functions

Similar packages