Class DeviceEndpoint
java.lang.Object
org.keycloak.protocol.AuthorizationEndpointBase
org.keycloak.protocol.oidc.grants.device.endpoints.DeviceEndpoint
- All Implemented Interfaces:
- Provider,- RealmResourceProvider
- Author:
- Hiroyuki Wada
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final org.jboss.logging.Loggerstatic final StringFields inherited from class org.keycloak.protocol.AuthorizationEndpointBaseAPP_INITIATED_FLOW, authManager, clientConnection, event, headers, httpRequest, realm, session
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()protected AuthenticationSessionModelcreateAuthenticationSession(ClientModel client, String scope) static OAuth2DeviceCodeModelgetDeviceByUserCode(KeycloakSession session, RealmModel realm, String userCode) Returns a JAX-RS resource instance.jakarta.ws.rs.core.ResponseHandles device authorization requests.jakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponseShowing the result of verification process for OAuth 2.0 Device Authorization Grant.jakarta.ws.rs.core.ResponseVerifies the code provided by the end-user and start the authentication.jakarta.ws.rs.core.ResponseverifyUserCode(String userCode) This endpoint is used by end-users to start the flow to authorize a device.Methods inherited from class org.keycloak.protocol.AuthorizationEndpointBasecheckRealm, checkSsl, createProcessor, getAuthenticationFlow, handleBrowserAuthenticationRequest
- 
Field Details- 
loggerprotected static final org.jboss.logging.Logger logger
- 
SHORT_VERIFICATION_URI- See Also:
 
 
- 
- 
Constructor Details- 
DeviceEndpoint
 
- 
- 
Method Details- 
handleDeviceRequest@Path("") @POST @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public jakarta.ws.rs.core.Response handleDeviceRequest()Handles device authorization requests.- Returns:
- the device authorization response.
 
- 
preflight@OPTIONS public jakarta.ws.rs.core.Response preflight()
- 
verifyUserCodeThis endpoint is used by end-users to start the flow to authorize a device.- Parameters:
- userCode- the user code to authorize
- Returns:
 
- 
verifyUserCode@Path("/") @POST @Consumes("application/x-www-form-urlencoded") public jakarta.ws.rs.core.Response verifyUserCode()Verifies the code provided by the end-user and start the authentication.- Returns:
 
- 
statusShowing the result of verification process for OAuth 2.0 Device Authorization Grant. This outputs login success or failure messages.- Parameters:
- error-
- Returns:
 
- 
getDeviceByUserCodepublic static OAuth2DeviceCodeModel getDeviceByUserCode(KeycloakSession session, RealmModel realm, String userCode) 
- 
getResourceDescription copied from interface:RealmResourceProviderReturns a JAX-RS resource instance. - Specified by:
- getResourcein interface- RealmResourceProvider
- Returns:
- a JAX-RS sub-resource instance
 
- 
closepublic void close()
- 
createAuthenticationSession- Overrides:
- createAuthenticationSessionin class- AuthorizationEndpointBase
 
 
-