Class OAuth2DeviceAuthorizationConsentAuthenticationProvider
java.lang.Object
org.springframework.security.oauth2.server.authorization.authentication.OAuth2DeviceAuthorizationConsentAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public final class OAuth2DeviceAuthorizationConsentAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
An
AuthenticationProvider
implementation for the Device Authorization Consent
used in the OAuth 2.0 Device Authorization Grant.- Since:
- 1.1
- See Also:
-
OAuth2DeviceAuthorizationConsentAuthenticationToken
OAuth2AuthorizationConsent
OAuth2DeviceAuthorizationRequestAuthenticationProvider
OAuth2DeviceVerificationAuthenticationProvider
OAuth2DeviceCodeAuthenticationProvider
RegisteredClientRepository
OAuth2AuthorizationService
OAuth2AuthorizationConsentService
-
Constructor Summary
ConstructorsConstructorDescriptionOAuth2DeviceAuthorizationConsentAuthenticationProvider
(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService, OAuth2AuthorizationConsentService authorizationConsentService) Constructs anOAuth2DeviceAuthorizationConsentAuthenticationProvider
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authentication
authenticate
(org.springframework.security.core.Authentication authentication) void
setAuthorizationConsentCustomizer
(Consumer<OAuth2AuthorizationConsentAuthenticationContext> authorizationConsentCustomizer) Sets theConsumer
providing access to theOAuth2AuthorizationConsentAuthenticationContext
containing anOAuth2AuthorizationConsent.Builder
and additional context information.boolean
-
Constructor Details
-
OAuth2DeviceAuthorizationConsentAuthenticationProvider
public OAuth2DeviceAuthorizationConsentAuthenticationProvider(RegisteredClientRepository registeredClientRepository, OAuth2AuthorizationService authorizationService, OAuth2AuthorizationConsentService authorizationConsentService) Constructs anOAuth2DeviceAuthorizationConsentAuthenticationProvider
using the provided parameters.- Parameters:
registeredClientRepository
- the repository of registered clientsauthorizationService
- the authorization serviceauthorizationConsentService
- the authorization consent service
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticate
in interfaceorg.springframework.security.authentication.AuthenticationProvider
- Throws:
org.springframework.security.core.AuthenticationException
-
supports
- Specified by:
supports
in interfaceorg.springframework.security.authentication.AuthenticationProvider
-
setAuthorizationConsentCustomizer
public void setAuthorizationConsentCustomizer(Consumer<OAuth2AuthorizationConsentAuthenticationContext> authorizationConsentCustomizer) Sets theConsumer
providing access to theOAuth2AuthorizationConsentAuthenticationContext
containing anOAuth2AuthorizationConsent.Builder
and additional context information.The following context attributes are available:
- The
OAuth2AuthorizationConsent.Builder
used to build the authorization consent prior toOAuth2AuthorizationConsentService.save(OAuth2AuthorizationConsent)
. - The
Authentication
of typeOAuth2DeviceAuthorizationConsentAuthenticationToken
. - The
RegisteredClient
associated with the device authorization request. - The
OAuth2Authorization
associated with the state token presented in the device authorization consent request.
- Parameters:
authorizationConsentCustomizer
- theConsumer
providing access to theOAuth2AuthorizationConsentAuthenticationContext
containing anOAuth2AuthorizationConsent.Builder
- The
-