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

register: secret hash issue #105

Open
anyeone opened this issue Apr 27, 2018 · 1 comment
Open

register: secret hash issue #105

anyeone opened this issue Apr 27, 2018 · 1 comment

Comments

@anyeone
Copy link

anyeone commented Apr 27, 2018

I have an app pool with a client secret and either I'm doing something wrong, or i've uncovered an issue with the register() method when requiring a client secret.

The instructions for instantiating the Cognito object for register do not include the username parameter (which makes sense, since you are trying to create one). So self.username is None.

However, the register method calls:
self._add_secret_hash(params, 'SecretHash')
which if you follow the tree is trying to hash self.username + client id + client secret.
BEFORE it creates the user, so it throws a null reference exception.

I think that the readme needs to state that if you have a client secret, you need to include the username when you instantiate Cognito (or alternatively, modify the implementation to populate the self.username from the one passed in on the register() method BEFORE trying to add secret hash.

@metoikos
Copy link

metoikos commented Nov 26, 2019

We are already passing username argument to the register method. It could update the class attribute self.username then it would solve the problem.

I don't know if you are maintaining this library (and saw that 15 PR's are waiting) but if you accept I can create another one to fix this issue.

alastairmccormack pushed a commit to alastairmccormack/pycognito that referenced this issue Feb 15, 2022
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@6.2.5...7.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

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