-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expires_in, expires_datetime attributes missing from Cognito instance after authenticate() #16
Comments
Taking a quick look at the authentication function, it does not set the
def authenticate(self, password):
"""
Authenticate the user using the SRP protocol
:param password: The user's passsword
:return:
"""
aws = AWSSRP(
username=self.username,
password=password,
pool_id=self.user_pool_id,
client_id=self.client_id,
client=self.client,
client_secret=self.client_secret,
)
tokens = aws.authenticate_user()
self.verify_token(tokens["AuthenticationResult"]["IdToken"], "id_token", "id")
self.refresh_token = tokens["AuthenticationResult"]["RefreshToken"]
self.verify_token(
tokens["AuthenticationResult"]["AccessToken"], "access_token", "access"
)
self.token_type = tokens["AuthenticationResult"]["TokenType"]
# Set expires_in and expires_datetime with tokens["AuthenticationResult"]["ExpiresIn"] On a side note, many other functions would need to be updated to assign these attributes, not just the |
Seeing the same behaviour... is the README just not quite aligned with what actually happens? Is there a different flow where those attributes are being set? |
@janhurst Seems like the README is not aligned with what is actually happening. There is not another flow that I am aware of. Nothing seems to be making use of the |
Hi, I am using pycognito following your authenticate example from the README.
When I run the
authenticate()
method on a Cognito instance (created with a Cognito User Pool ID, Cognito Client ID, and username), I do not get an instance with the.expires_in
or.expires_datetime
attributes as described. I do seeid_token
,refresh_token
,access_token
, andtoken_type
, though.The text was updated successfully, but these errors were encountered: