question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change temporary password - chicken and egg???

See original GitHub issue

OK, this is a really stupid and basic question…

  1. Create a new user in a user pool.
  2. User tried to authenticate using temporary password.
  3. Exception is raised about force password change
  4. Try to change password - Can’t without access token

Can’t get an access token without authenticating. Can’t get access token without changing password.

How do we get around this?

I see a number of posts here 25, 13, 14 and 29 but is is still not making sense to my noobie brain.

import boto3
from warrant import Cognito

identity_pool_id = 'us-east-1_XXXXXXXXXX'
app_client_id = 'XXXXXXXXXXXXXXXXXXXXXXX'
username = 'erics'
password = 'XXXXXXXX'
new_password = 'newXXXXXXXX'

cog = Cognito(identity_pool_id, app_client_id, username)

try:
    cog.authenticate(password=password)
except:
    cog.change_password(password, new_password)

Traceback (most recent call last): File "C:\Users\Eric\Documents\cognito.py", line 15, in <module> cog.change_password(password, new_password) File "C:\Users\Eric\AppData\Local\Programs\Python\Python36\lib\site-packages\warrant\__init__.py", line 613, in change_password self.check_token() File "C:\Users\Eric\AppData\Local\Programs\Python\Python36\lib\site-packages\warrant\__init__.py", line 253, in check_token raise AttributeError('Access Token Required to Check Token') AttributeError: Access Token Required to Check Token

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
armicroncommented, Nov 26, 2017

Don’t use except without a specific exception.

except ForceChangePasswordException:

When this exception occurs you need to call set_new_password_challenge(new_password) https://github.com/capless/warrant/blob/master/warrant/aws_srp.py#L224

1reaction
armicroncommented, Nov 27, 2017

@flycast it’s a bad practice to use ‘*’ in imports, be patient with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid a chicken and egg scenario with encrypting ...
Users have one password (corp ldap) and can change it whenever without affecting the application or the decryption process; One keypair per user ......
Read more >
How do I change or reset a login password in CCH Axcess
On the ribbon, in the Settings group, click Reset Login Password. An email will be sent to the staff member with a temporary...
Read more >
Break glass accounts and Azure AD Security Defaults
The chicken and egg problem. Luckily, this problem can be solved with a Temporary Access Pass. See how this relatively easy thing has...
Read more >
Big Y World Class Market: Local Grocery Store & Supermarket
Explore Big Y World Class Market, an all in one supermarket featuring a butcher, fresh seafood, bakery, deli, and local produce with locations...
Read more >
How do I reset my password? - Good Eggs
From goodeggs.com click on Forgot password? on the sign-up page, and we'll send you an email to help you reset it. From the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found