Class DefaultSessionAuthenticationStrategy
- java.lang.Object
-
- com.broadleafcommerce.auth.user.service.DefaultSessionAuthenticationStrategy
-
- All Implemented Interfaces:
org.springframework.security.web.authentication.session.SessionAuthenticationStrategy
public class DefaultSessionAuthenticationStrategy extends Object implements org.springframework.security.web.authentication.session.SessionAuthenticationStrategy
This is used to set the session cookie after successful authentication. It is intended to be used for all authentication types. Each authentication flow should register its ownAuthenticationStrategyDelegateto facilitate loading anOAuth2UserDetailsfrom anAuthentication.
-
-
Constructor Summary
Constructors Constructor Description DefaultSessionAuthenticationStrategy(StatelessUtil statelessUtil, List<AuthenticationStrategyDelegate> authenticationStrategyDelegates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<AuthenticationStrategyDelegate>getAuthenticationStrategyDelegates()protected OAuth2UserDetailsgetOAuth2UserDetails(@NonNull org.springframework.security.core.Authentication authentication)protected StatelessUtilgetStatelessUtil()voidonAuthentication(@NonNull org.springframework.security.core.Authentication authentication, @NonNull javax.servlet.http.HttpServletRequest request, @NonNull javax.servlet.http.HttpServletResponse response)protected voidsetSessionCookie(@NonNull javax.servlet.http.HttpServletResponse response, @NonNull OAuth2UserDetails oAuth2UserDetails)
-
-
-
Constructor Detail
-
DefaultSessionAuthenticationStrategy
public DefaultSessionAuthenticationStrategy(StatelessUtil statelessUtil, List<AuthenticationStrategyDelegate> authenticationStrategyDelegates)
-
-
Method Detail
-
onAuthentication
public void onAuthentication(@NonNull @NonNull org.springframework.security.core.Authentication authentication, @NonNull @NonNull javax.servlet.http.HttpServletRequest request, @NonNull @NonNull javax.servlet.http.HttpServletResponse response) throws org.springframework.security.web.authentication.session.SessionAuthenticationException- Specified by:
onAuthenticationin interfaceorg.springframework.security.web.authentication.session.SessionAuthenticationStrategy- Throws:
org.springframework.security.web.authentication.session.SessionAuthenticationException
-
getOAuth2UserDetails
protected OAuth2UserDetails getOAuth2UserDetails(@NonNull @NonNull org.springframework.security.core.Authentication authentication)
-
setSessionCookie
protected void setSessionCookie(@NonNull @NonNull javax.servlet.http.HttpServletResponse response, @NonNull @NonNull OAuth2UserDetails oAuth2UserDetails)
-
getStatelessUtil
protected StatelessUtil getStatelessUtil()
-
getAuthenticationStrategyDelegates
protected List<AuthenticationStrategyDelegate> getAuthenticationStrategyDelegates()
-
-