public class EmbeddedLoginTokenAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
TokenEndpoint
based on a one-time
passcode parameter.Constructor and Description |
---|
EmbeddedLoginTokenAuthenticationProvider(OAuth2UserDetailsService userDetailsService,
PasscodeService<PasswordToken,User> passcodeService,
UserService<User> userService) |
Modifier and Type | Method and Description |
---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication) |
protected EmbeddedLoginTokenEndpointAuthenticationToken |
buildEmbeddedLoginTokenEndpointAuthenticationToken(OAuth2UserDetails userDetails,
String clientId,
String username,
String scope,
String code,
String purpose)
|
protected org.springframework.security.oauth2.provider.OAuth2Request |
buildOAuth2Request(String clientId,
OAuth2UserDetails userDetails,
String scope)
Build a synthetic
OAuth2Request . |
protected PasscodeService<PasswordToken,User> |
getPasscodeService() |
protected OAuth2UserDetailsService |
getUserDetailsService() |
protected UserService<User> |
getUserService() |
boolean |
supports(Class<?> authentication) |
public EmbeddedLoginTokenAuthenticationProvider(OAuth2UserDetailsService userDetailsService, PasscodeService<PasswordToken,User> passcodeService, UserService<User> userService)
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
authenticate
in interface org.springframework.security.authentication.AuthenticationProvider
org.springframework.security.core.AuthenticationException
protected EmbeddedLoginTokenEndpointAuthenticationToken buildEmbeddedLoginTokenEndpointAuthenticationToken(OAuth2UserDetails userDetails, String clientId, String username, String scope, String code, String purpose)
userDetails
- The UserDetails
for
the authenticated User.clientId
- The client_id from the request.username
- The username of the authenticated User.scope
- The requested scopes.code
- The one-time passcode used for authentication.purpose
- The purpose of the one-time passcode used for authentication.EmbeddedLoginTokenEndpointAuthenticationToken
.protected org.springframework.security.oauth2.provider.OAuth2Request buildOAuth2Request(String clientId, OAuth2UserDetails userDetails, String scope)
OAuth2Request
. This is needed to issue tokens from the
TokenEndpoint
.clientId
- The client_id from the request.userDetails
- The UserDetails
for
the authenticated User.scope
- The requested scopes.OAuth2Request
.public boolean supports(Class<?> authentication)
supports
in interface org.springframework.security.authentication.AuthenticationProvider
protected PasscodeService<PasswordToken,User> getPasscodeService()
protected OAuth2UserDetailsService getUserDetailsService()
protected UserService<User> getUserService()
Copyright © 2021. All rights reserved.