Class EmbeddedLoginTokenAuthenticationProvider
java.lang.Object
com.broadleafcommerce.auth.user.session.embedded.EmbeddedLoginTokenAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public class EmbeddedLoginTokenAuthenticationProvider
extends Object
implements org.springframework.security.authentication.AuthenticationProvider
Authenticates the user for the
TokenEndpoint based on a one-time
passcode parameter.- Author:
- Cade Rea (cade-rea)
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedLoginTokenAuthenticationProvider(OAuth2UserDetailsService userDetailsService, PasscodeService<PasswordToken, User> passcodeService, UserService<User> userService, org.springframework.security.oauth2.provider.OAuth2RequestFactory oAuth2RequestFactory) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) buildEmbeddedLoginTokenEndpointAuthenticationToken(OAuth2UserDetails userDetails, String clientId, String username, String scope, String code, String purpose) protected org.springframework.security.oauth2.provider.OAuth2RequestbuildOAuth2Request(String clientId, OAuth2UserDetails userDetails, String requestedScope) Deprecated.protected org.springframework.security.oauth2.provider.OAuth2RequestbuildOAuth2Request(String clientId, String requestedScope, User user) Build a syntheticOAuth2Request.protected org.springframework.security.oauth2.provider.OAuth2RequestFactoryprotected PasscodeService<PasswordToken,User> protected OAuth2UserDetailsServiceprotected UserService<User>boolean
-
Constructor Details
-
EmbeddedLoginTokenAuthenticationProvider
public EmbeddedLoginTokenAuthenticationProvider(OAuth2UserDetailsService userDetailsService, PasscodeService<PasswordToken, User> passcodeService, UserService<User> userService, org.springframework.security.oauth2.provider.OAuth2RequestFactory oAuth2RequestFactory)
-
-
Method Details
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Specified by:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
buildEmbeddedLoginTokenEndpointAuthenticationToken
protected EmbeddedLoginTokenEndpointAuthenticationToken buildEmbeddedLoginTokenEndpointAuthenticationToken(OAuth2UserDetails userDetails, String clientId, String username, String scope, String code, String purpose) - Parameters:
userDetails- TheUserDetailsfor 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.- Returns:
- An authenticated
EmbeddedLoginTokenEndpointAuthenticationToken.
-
buildOAuth2Request
@Deprecated protected org.springframework.security.oauth2.provider.OAuth2Request buildOAuth2Request(String clientId, OAuth2UserDetails userDetails, String requestedScope) Deprecated.since 1.8 UsebuildOAuth2Request(String, String, User)Build a syntheticOAuth2Request. This is needed to issue tokens from theTokenEndpoint.- Parameters:
clientId- The client_id from the request.userDetails- TheUserDetailsfor the authenticated User.requestedScope- The requested scopes.- Returns:
- An approved
OAuth2Request.
-
buildOAuth2Request
protected org.springframework.security.oauth2.provider.OAuth2Request buildOAuth2Request(String clientId, String requestedScope, @Nullable User user) Build a syntheticOAuth2Request. This is needed to issue tokens from theTokenEndpoint.- Parameters:
clientId- The client_id from the request.requestedScope- The requested scopes.- Returns:
- An approved
OAuth2Request.
-
supports
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-
getPasscodeService
-
getUserDetailsService
-
getUserService
-
getOAuth2RequestFactory
protected org.springframework.security.oauth2.provider.OAuth2RequestFactory getOAuth2RequestFactory()
-
buildOAuth2Request(String, String, User)