Skip to content

Cognito /userinfo endpoint not consistent with OIDC spec

0

We use an app integration + hosted UI on our Cognito user pool to act as an OIDC provider to federate friendly services to login with ours. This works great except for the /userinfo endpoint, whose return value is not consistent with the spec. Specifically, the email_verified body element is returned as a string rather than a bool.

We've had to build a whole API Gateway proxy with Lambda integration just to properly cast this one value. This is an awesome feature of Cognito, but it definitely reduces the usefulness of implementing an open standard if it doesn't follow the spec!

Since we've got it working this is not priority, just submitting a bug report that the OIDC implementation doesn't properly implement OIDC :)

1 Answer
0
Accepted Answer

Hello,

Hope all is well on your end.

Thank you for reaching out to us with your feedback pertaining to the Amazon Cognito userInfo endpoint returning the email_verified body element as a string rather than a bool.

Currently, this is a limitation with Cognito as Cognito does not return email_verified attribute as a Boolean, it instead returns it as a string. We have heard this request from other customers and will consider it in future updates to the service. I would like to inform you that this is not an error but its current limitation from Cognito side and I really apologize for any inconvenience caused to you due to the service limitation.

We do have an existing feature request with service team for this limitation however I will not be able to provide you an ETA when this feature would be released as we do not have insight to the roadmaps of the internal team. However, I do encourage you to monitor our What's New page and AWS blog as all of our feature announcements are made there.

A probable workaround to this is to get the same information from the ID token payload where email_verified is returned as a bool [1] however you have already implemented your own workaround to overcome this.

[1] ID token default payload - https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-id-token.html#user-pool-id-token-payload

Kind regards.

AWS
SUPPORT ENGINEER

answered 2 years ago

  • Thank you, Qasim,

    Unfortunately our federating partner uses a pre-built OIDC client that expects the ID provider to respect the specification, including having a valid /userinfo, but as mentioned we do have a (hacky) workaround.

    Surely though this shouldn't be considered a feature request but a bug fix? Because of this Cognito is actually broken: the OIDC feature is unusable as-is. Having your implementation of a protocol match the specification is not a "nice to have," but a necessity I would think?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.