Skip to content
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

Access Token Required to Check Token in changing password #14

Closed
blade2005 opened this issue Apr 11, 2017 · 2 comments
Closed

Access Token Required to Check Token in changing password #14

blade2005 opened this issue Apr 11, 2017 · 2 comments

Comments

@blade2005
Copy link

Utilizing the develop branch commit a53cb08

In related to #13 I opted to change the code in my file to change my password and encountered the following error:

    config = ce.get_config('Cognito', args.configfile)
    u = Cognito(config['pool_id'],config['client_id'], username=args.username)
    response = u.change_password(args.password, args.new_password)

Traceback (most recent call last):
  File "bin/auth-cognito", line 40, in <module>
    main()
  File "bin/auth-cognito", line 35, in main
    response = u.change_password(args.password, args.new_password)
  File "/home/cdavis/.local/lib/python2.7/site-packages/warrant/__init__.py", line 380, in change_password
    self.check_token()
  File "/home/cdavis/.local/lib/python2.7/site-packages/warrant/__init__.py", line 119, in check_token
    raise AttributeError('Access Token Required to Check Token')
AttributeError: Access Token Required to Check Token

If I haven't authenticated how would I have a access token?

@ebpetway
Copy link
Contributor

You won't be able to change the user password using change_password in this situation, which is where an admin has created a user with a temporary password.
The way the password will need to be updated is via another respond_to_auth boto3 client call, like so:

tokens = boto_client.respond_to_auth_challenge(
    ClientId='client_id',
    ChallengeName='NEW_PASSWORD_REQUIRED',
    Session='session_string_from_first_challenge_response',
    ChallengeResponses={
        'NEW_PASSWORD': 'new_password',
        'USERNAME': 'username'
    }
)

@blade2005
Copy link
Author

Ohhh. So it more directly ties back into #13 alright. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants