-
Notifications
You must be signed in to change notification settings - Fork 137
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
Failed userinfo unmarshal with AWS Cognito due to email_verified being text field. #137
Comments
HI @jozuenoon Thanks for reporting this issue. Can you provide some more information about the error you receive? CC @caos/zitadel |
Hi! Response headers don't contain anything interesting I think. I can drop full error response:
I'm running callback with
Replacing boolean with custom type with |
Hi @jozuenoon We have implemented the library using the OpenID spec. The specs defines the email verified attribute as a boolean. In your request the field is a text and because of that an error is returned. In this case the error is correct. We had a look at the aws docs and they refer to the standard claims docs of OpenID. |
Hi! It's an inconsistency on the AWS side. However, the problem seems to be recognized and ignored eg. https://forums.aws.amazon.com/thread.jspa?messageID=949441󧳁 Maybe it's possible to change this bug report into enhancement and gracefully handle boolean conversions? |
Well that's a bummer with AWS 😢 Do you want to contribute a PR for this? |
For reference other libs have to work around that issues as well |
I also found a similar issue with Auth0 today: https://community.auth0.com/t/userinfo-endpoint-in-oidc-returns-updated-at-field-as-a-string/62754 The library can't unmarshal I will try to wrap some fixes up and PR next week 👍 |
It is astonishing how many spec. violations are in the wild 😁 Thanks for your time 👍 |
This PR is for Cognito #139. I will try to scratch something for Auth0 as well. |
Describe the bug
AWS Cognito returns userinfo with email_verified field as text.
"userinfo failed: failed to unmarshal response: json: cannot unmarshal string into Go struct field .email_verified of type bool..."
To Reproduce
Steps to reproduce the behavior:
examples
folder.Expected behavior
Should read userinfo.
The text was updated successfully, but these errors were encountered: