Repository navigation
Replies: 3 comments 1 reply
|
Background: the above was discovered while working on DPoP. This feature relies on the ability to correctly inject |
|
@dteleguin @tnorimat +1 to all the points. Thanks for pointing this! My vote is also to add some note to the "Migration guide" to the documentation in relation to this because some clients can rely on the previous (no specs compliant) behaviour. I don't think that we need to cover backwards compatibility in the codebase as the behaviour is not specs compliant as you pointed. So just documentation is sufficient IMO. I would not add documentation about the last point (Token revocation check) as this one is a bit related to security, but other points (1,2,3 and openid scope) will be nice to document. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The UserInfo endpoint currently handles error cases in a way that seems to be not fully standards compliant.
According to OpenID Connect Core 1.0, chapter 5.3 UserInfo Endpoint:
Currently, when handling error cases, the UserInfo endpoint behaves in a manner more similar the Token endpoint rather than an OAuth 2.0 protected resource.
400 Bad Request, noWWW-Authenticateheader, and a JSON body:But, according to RFC6750, it SHOULD respond with a
401 Unauthorized; MUST include the HTTPWWW-Authenticateresponse header field; SHOULD NOT include an error code or other error information:Among the prominent IdMs that do follow this convention are Ping (link), Okta (link), Connect2ID (link), Auth0 and IdentityServer4.
In case of any error condition, UserInfo responds with a JSON body containing
erroranderror_descriptionattributes. This mimics the behavior of the Token endpoint; there is no such requirement for OAuth 2.0 protected resources using bearer token authentication, so this behavior is non-standard. By providing a JSON body for error responses, we encourage the users to depend on a non-standard feature.In case of invalid MTLS binding and/or missing client certificate, the
unauthorized_clienterror code is used. This is not recognized as a valid error code for OAuth 2.0 protected resources; most likely this has been borrowed from Token endpoint where it would be indeed a valid error code. Justin Richer of OAuth WG recommends to useinvalid_tokeninstead, both for invalid binding and missing/invalid client certificate. @tnorimatAlso, a couple of minor issues not directly related to the standards:
openidscope check: as UserInfo is a feature exclusive to OIDC, it might make sense to reject access tokens that do not have theopenidscope. IdentityServer4 is one of the IdMs that is known to do that.All reactions