public class EmbeddedLoginAuthenticationSuccessHandler<P extends PasswordToken,U extends User> extends Object implements org.springframework.security.web.authentication.AuthenticationSuccessHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
ONE_TIME_PASSCODE_PURPOSE |
| Constructor and Description |
|---|
EmbeddedLoginAuthenticationSuccessHandler(PasscodeService<P,U> passcodeService,
UserService<U> userService,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
protected PasscodeService<P,U> |
getPasscodeService() |
protected UserService<U> |
getUserService() |
void |
onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.Authentication authentication) |
protected Optional<U> |
readUser(javax.servlet.http.HttpServletRequest request)
Get a user from request parameters.
|
protected void |
writeOTPtoResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Create a new passcode and write it to the response.
|
protected void |
writeToResponse(javax.servlet.http.HttpServletResponse response,
P token)
Write a One-Time Passcode wrapped in a
EmbeddedLoginOTPResponse to the response. |
public static final String ONE_TIME_PASSCODE_PURPOSE
public EmbeddedLoginAuthenticationSuccessHandler(PasscodeService<P,U> passcodeService, UserService<U> userService, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.Authentication authentication)
onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandlerprotected void writeOTPtoResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - The HttpServletRequest that is being processed.response - The HttpServletResponse that will be sent back to the user.protected Optional<U> readUser(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest with "client_id" and "username" parameters.protected void writeToResponse(javax.servlet.http.HttpServletResponse response,
P token)
throws IOException
EmbeddedLoginOTPResponse to the response.response - The HttpServletResponse that will be sent back to the user.token - The PasswordToken to write to the response.IOException - If there is a problem serializing the EmbeddedLoginOTPResponse or
writing to the response.protected PasscodeService<P,U> getPasscodeService()
protected UserService<U> getUserService()
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Copyright © 2021. All rights reserved.