Package org.mockserver.oidc
Class OidcDeviceAuthorizationCallback
java.lang.Object
org.mockserver.oidc.OidcDeviceAuthorizationCallback
- All Implemented Interfaces:
ExpectationCallback<HttpResponse>,ExpectationResponseCallback
Mock OIDC/OAuth2 device-authorization endpoint, implementing the OAuth 2.0 Device Authorization Grant
(RFC 8628 §3.2).
This is a mock — there is no device login UI. It issues an opaque device_code paired with a
short human-readable user_code, records them (with the requested scope) in
OidcAuthorizationStore, and returns the RFC 8628 device-authorization response:
device_code, user_code, verification_uri, verification_uri_complete, expires_in, interval.
The client then polls /token with
grant_type=urn:ietf:params:oauth:grant-type:device_code (handled by OidcTokenCallback),
which answers authorization_pending for the configured number of polls before minting tokens.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringRFC 8628 device-code grant type used when polling the token endpoint. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandle(HttpRequest request) Called for every request when expectation condition has been satisfied.
-
Field Details
-
DEVICE_CODE_GRANT_TYPE
RFC 8628 device-code grant type used when polling the token endpoint.- See Also:
-
-
Constructor Details
-
OidcDeviceAuthorizationCallback
public OidcDeviceAuthorizationCallback()
-
-
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
-