@Component public class LoginSuccessHandler extends Object implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
LoginAuthProvider
when the user is successfully
authenticated. This class is responsible for returning LoginResponse
with
access_token on successful login.Constructor and Description |
---|
LoginSuccessHandler(com.fasterxml.jackson.databind.ObjectMapper mapper,
JwtTokenService tokenService,
AuditLog auditLog) |
Modifier and Type | Method and Description |
---|---|
void |
onAuthenticationSuccess(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
org.springframework.security.core.Authentication authentication)
Since we are using multiple
AuthenticationProvider s, make sure to convert the
authentication principal to proper OneOpsUser type. |
public LoginSuccessHandler(com.fasterxml.jackson.databind.ObjectMapper mapper, JwtTokenService tokenService, AuditLog auditLog)
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.springframework.security.core.Authentication authentication) throws IOException, javax.servlet.ServletException
AuthenticationProvider
s, make sure to convert the
authentication principal to proper OneOpsUser
type.onAuthenticationSuccess
in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
req
- http request.res
- http response.authentication
- authentication objectIOException
javax.servlet.ServletException
Copyright © 2018 Walmart, Inc.. All rights reserved.