Class DeviceClientAuthenticationProvider
java.lang.Object
com.irurueta.authserver.authorization.api.web.implicit.DeviceClientAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public class DeviceClientAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
Authenticates a public client of the device flow by its identifier: the client must be registered and must have
registered the
none authentication method, which is what makes it public. It accepts only the requests
DeviceClientAuthenticationConverter built (a DeviceClientAuthenticationToken), so it can never stand
in for the PKCE verification of another request of a public client.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringReference to the standard that describes the failure.private final org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepositoryFinds the registered clients. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) Authenticates the client.private static org.springframework.security.oauth2.core.OAuth2AuthenticationExceptioninvalidClient(String parameterName) Builds the failure.booleanTells which requests this provider authenticates.
-
Field Details
-
ERROR_URI
Reference to the standard that describes the failure.- See Also:
-
registeredClientRepository
private final org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepositoryFinds the registered clients.
-
-
Constructor Details
-
DeviceClientAuthenticationProvider
public DeviceClientAuthenticationProvider()
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException Authenticates the client.- Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Parameters:
authentication- the request of a public client of the device flow.- Returns:
- the authenticated client.
- Throws:
org.springframework.security.core.AuthenticationException-invalid_clientif the client is unknown or is not a public one.
-
supports
Tells which requests this provider authenticates.- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider- Parameters:
authentication- the type of the request.- Returns:
truefor aDeviceClientAuthenticationToken.
-
invalidClient
private static org.springframework.security.oauth2.core.OAuth2AuthenticationException invalidClient(String parameterName) Builds the failure.- Parameters:
parameterName- what failed.- Returns:
- the exception.
-