Beispiel #1
0
    def _get_cognito_token(self) -> str:
        """Use Pycognito library to authenticate with Amazon Cognito and retrieve FMID token."""

        user = pycognito.Cognito(user_pool_id=self.cognito_userpool_id,
                                 client_id=self.cognito_client_id,
                                 username=self.user)
        user.authenticate(self.password)
        return user.id_token
Beispiel #2
0
 def _cognito(self, **kwargs):
     """Get the client credentials."""
     return pycognito.Cognito(
         user_pool_id=self.cloud.user_pool_id,
         client_id=self.cloud.cognito_client_id,
         user_pool_region=self.cloud.region,
         botocore_config=botocore.config.Config(signature_version=botocore.UNSIGNED),
         session=self._session,
         **kwargs,
     )