Class DeviceProtocolChainCustomizer

java.lang.Object
com.irurueta.authserver.authorization.api.web.implicit.DeviceProtocolChainCustomizer
All Implemented Interfaces:
ProtocolChainCustomizer

public class DeviceProtocolChainCustomizer extends Object implements 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

    Fields
    Modifier and Type
    Field
    Description
    private final org.springframework.security.web.authentication.AuthenticationConverter
    Reads the identifier of a public client of the device flow.
    private final org.springframework.security.authentication.AuthenticationProvider
    Authenticates a public client of the device flow.
    private final org.springframework.security.web.authentication.AuthenticationFailureHandler
    Answers the failures of the verification endpoint.
    private final org.springframework.security.web.authentication.AuthenticationConverter
    Rate limit and multi-factor policy of the verification requests.
    static final int
    Order of the customizer: after the multi-factor (0) and step-up (1) ones.
    private final org.springframework.security.web.authentication.AuthenticationSuccessHandler
    Answers a verification that did not need consent, or whose consent was given.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    customize(org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer server)
    Customizes the device endpoints.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ORDER

      public static final int ORDER
      Order of the customizer: after the multi-factor (0) and step-up (1) ones.
      See Also:
    • clientConverter

      private final org.springframework.security.web.authentication.AuthenticationConverter clientConverter
      Reads the identifier of a public client of the device flow.
    • clientProvider

      private final org.springframework.security.authentication.AuthenticationProvider clientProvider
      Authenticates a public client of the device flow.
    • guard

      private final org.springframework.security.web.authentication.AuthenticationConverter guard
      Rate limit and multi-factor policy of the verification requests.
    • errorHandler

      private final org.springframework.security.web.authentication.AuthenticationFailureHandler errorHandler
      Answers the failures of the verification endpoint.
    • successHandler

      private final org.springframework.security.web.authentication.AuthenticationSuccessHandler successHandler
      Answers 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:
      customize in interface ProtocolChainCustomizer
      Parameters:
      server - configurer of the authorization server.