Class DeviceProtocolChainCustomizer
java.lang.Object
com.irurueta.authserver.authorization.api.web.implicit.DeviceProtocolChainCustomizer
- All Implemented Interfaces:
ProtocolChainCustomizer
Enables the OAuth 2.0 Device Authorization Grant on the protocol chain. The device authorization endpoint
(
POST /oauth2/device_authorization) is where the device, authenticated as a public client by its identifier
alone, obtains a device code and a user code. The verification endpoint (/oauth2/device_verification) is
where the signed-in user approves the device; its verification URI is the framework's default, the issuer plus the
endpoint, whose GET without a code is the page of DeviceVerificationController. The verification
endpoint is customized to guard its requests (DeviceVerificationRequestGuard), to hand the consent decision
to the existing consent page, to answer its failures with DeviceVerificationErrorHandler and to go back to
the verification page when the device was approved.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.security.web.authentication.AuthenticationConverterReads the identifier of a public client of the device flow.private final org.springframework.security.authentication.AuthenticationProviderAuthenticates a public client of the device flow.private final org.springframework.security.web.authentication.AuthenticationFailureHandlerAnswers the failures of the verification endpoint.private final org.springframework.security.web.authentication.AuthenticationConverterRate limit and multi-factor policy of the verification requests.static final intOrder of the customizer: after the multi-factor (0) and step-up (1) ones.private final org.springframework.security.web.authentication.AuthenticationSuccessHandlerAnswers a verification that did not need consent, or whose consent was given. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomize(org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer server) Customizes the device endpoints.
-
Field Details
-
ORDER
public static final int ORDEROrder of the customizer: after the multi-factor (0) and step-up (1) ones.- See Also:
-
clientConverter
private final org.springframework.security.web.authentication.AuthenticationConverter clientConverterReads the identifier of a public client of the device flow. -
clientProvider
private final org.springframework.security.authentication.AuthenticationProvider clientProviderAuthenticates a public client of the device flow. -
guard
private final org.springframework.security.web.authentication.AuthenticationConverter guardRate limit and multi-factor policy of the verification requests. -
errorHandler
private final org.springframework.security.web.authentication.AuthenticationFailureHandler errorHandlerAnswers the failures of the verification endpoint. -
successHandler
private final org.springframework.security.web.authentication.AuthenticationSuccessHandler successHandlerAnswers a verification that did not need consent, or whose consent was given.
-
-
Constructor Details
-
DeviceProtocolChainCustomizer
public DeviceProtocolChainCustomizer()
-
-
Method Details
-
customize
public void customize(org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer server) Customizes the device endpoints.- Specified by:
customizein interfaceProtocolChainCustomizer- Parameters:
server- configurer of the authorization server.
-