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

change_password: Access Token Required to Check Token #29

Closed
mscheper opened this issue May 11, 2017 · 3 comments
Closed

change_password: Access Token Required to Check Token #29

mscheper opened this issue May 11, 2017 · 3 comments

Comments

@mscheper
Copy link

I apologise if this isn't the right place to post what's probably a naïve question. Let me know if there's a better place.

I don't seem to be able to get change_password to work. Or is this in essence what #13 is about?

    cognito = Cognito(identity_pool_id, app_client_id, username=username)

    cognito_id_token = cognito.id_token
    cognito_refresh_token = cognito.refresh_token
    cognito_access_token = cognito.access_token

    try:
        cognito.authenticate(password=password)
    except ForceChangePasswordException:
        cognito2 = Cognito(identity_pool_id, app_client_id,
                id_token = cognito_id_token,
                refresh_token = cognito_refresh_token,
                access_token = cognito_access_token,
        )
        cognito2.change_password(password, new_password)

This is the exception I get:

  File (my dodgy code), in my_function
    cognito2.change_password(password, new_password)
  File ".../warrant/__init__.py", line 515, in change_password
    self.check_token()
  File ".../warrant/__init__.py", line 196, in check_token
    raise AttributeError('Access Token Required to Check Token')
AttributeError: Access Token Required to Check Token
@mscheper
Copy link
Author

Never mind. This is pretty much a dupe of #14.

@mscheper
Copy link
Author

I just found that the fix described in #25 already works, too. new_password_challenge() isn't documented in README.md, though. I'm happy to add it, if it doesn't steal anyone's thunder. @bjinwright?

@bjinwright
Copy link
Member

I always welcome PRs especially README PRs

macpijan added a commit to 3mdeb/warrant that referenced this issue Sep 4, 2018
This problem was raised in a number of issues such as this one:
capless#29

The `set_new_password_challenge()` was introduced in the:
capless#25 and is not yet documented.

This should help the newcomers to get started with this module.

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
alastairmccormack pushed a commit to alastairmccormack/pycognito that referenced this issue Feb 2, 2022
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.3.5 to 6.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@5.3.5...6.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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