Package org.mockserver.oidc
Class OidcTokenCallback
java.lang.Object
org.mockserver.oidc.OidcTokenCallback
- All Implemented Interfaces:
ExpectationCallback<HttpResponse>,ExpectationResponseCallback
Mock OIDC
/token endpoint.
For client_credentials, refresh_token, or any request without an
authorization_code grant, the provider's OidcTokenMinter mints a fresh token
response at request time, honouring the requested scope (and including a refresh_token for the
refresh_token grant).
For grant_type=authorization_code it completes the authorization-code flow: it consumes
the single-use code issued by OidcAuthorizationCodeCallback, validates the
redirect_uri matches the one bound at /authorize, validates the PKCE
code_verifier against the stored code_challenge (when one was supplied), then mints
the token response at request time — embedding the nonce echoed from the authorize request
into the id_token.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(HttpRequest request) Called for every request when expectation condition has been satisfied.
-
Constructor Details
-
OidcTokenCallback
public OidcTokenCallback()
-
-
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
-