Class OidcUserinfoCallback
- All Implemented Interfaces:
ExpectationCallback<HttpResponse>,ExpectationResponseCallback
Userinfo is an OAuth2 protected resource: it MUST be called with a bearer access token and
MUST return 401 when that token is missing or invalid (OIDC Core §5.3.1, RFC 6750 §3.1).
Behaviour change. This endpoint was previously a static response that returned sub
and every configured additional claim to any caller, with no inspection of the
Authorization header at all. That made two common tests impossible to fail:
"my application handles a 401 from userinfo when the access token has expired" could never see a
401, and "my application only calls userinfo with a valid token" passed unconditionally. It is the
same fabricated-success defect as the introspection endpoint, one endpoint over, and it survived for
the same reason the hardcoded issuer did: no test ever exercised the failure path.
Token resolution is delegated to OidcTokenResolver so this endpoint and
/introspect cannot drift into disagreeing about the same token.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(HttpRequest request) Called for every request when expectation condition has been satisfied.
-
Constructor Details
-
OidcUserinfoCallback
public OidcUserinfoCallback()
-
-
Method Details
-
handle
Description copied from interface:ExpectationResponseCallbackCalled for every request when expectation condition has been satisfied. The request that satisfied the expectation condition is passed as the parameter and the return value is the request that will be returned.- Specified by:
handlein interfaceExpectationCallback<HttpResponse>- Specified by:
handlein interfaceExpectationResponseCallback- Parameters:
request- the request that satisfied the expectation condition- Returns:
- the response that will be returned
-