Package io.micronaut.security.session
Class SessionLoginHandler
java.lang.Object
io.micronaut.security.session.SessionLoginHandler
- All Implemented Interfaces:
LoginHandler<io.micronaut.http.HttpRequest<?>,
,io.micronaut.http.MutableHttpResponse<?>> RedirectingLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>>
@Requires(condition=SessionAuthenticationModeCondition.class)
@Singleton
public class SessionLoginHandler
extends Object
implements RedirectingLoginHandler<io.micronaut.http.HttpRequest<?>,io.micronaut.http.MutableHttpResponse<?>>
A
RedirectingLoginHandler
implementation for session based authentication.- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
Modifier and TypeFieldDescriptionprotected final @Nullable String
protected final @Nullable String
protected final RedirectConfiguration
protected final io.micronaut.session.SessionStore<io.micronaut.session.Session>
-
Constructor Summary
ConstructorDescriptionSessionLoginHandler
(RedirectConfiguration redirectConfiguration, io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore, @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence, RedirectService redirectService) Deprecated, for removal: This API element is subject to removal in a future version.SessionLoginHandler
(RedirectConfiguration redirectConfiguration, io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore, @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence, RedirectService redirectService, List<SessionPopulator<io.micronaut.http.HttpRequest<?>>> sessionPopulators) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.http.MutableHttpResponse<?>
loginFailed
(AuthenticationResponse authenticationFailed, io.micronaut.http.HttpRequest<?> request) io.micronaut.http.MutableHttpResponse<?>
loginRefresh
(Authentication authentication, String refreshToken, io.micronaut.http.HttpRequest<?> request) io.micronaut.http.MutableHttpResponse<?>
loginSuccess
(Authentication authentication, io.micronaut.http.HttpRequest<?> request)
-
Field Details
-
loginSuccess
-
loginFailure
-
redirectConfiguration
-
sessionStore
protected final io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore
-
-
Constructor Details
-
SessionLoginHandler
@Inject public SessionLoginHandler(RedirectConfiguration redirectConfiguration, io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore, @Nullable @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence, RedirectService redirectService, List<SessionPopulator<io.micronaut.http.HttpRequest<?>>> sessionPopulators) Constructor.- Parameters:
redirectConfiguration
- Redirect configurationsessionStore
- The session storepriorToLoginPersistence
- The persistence to store the original urlredirectService
- Redirection ServicesessionPopulators
- Session Populators
-
SessionLoginHandler
@Deprecated(forRemoval=true, since="4.11.0") public SessionLoginHandler(RedirectConfiguration redirectConfiguration, io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore, @Nullable @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence, RedirectService redirectService) Deprecated, for removal: This API element is subject to removal in a future version.Constructor.- Parameters:
redirectConfiguration
- Redirect configurationsessionStore
- The session storepriorToLoginPersistence
- The persistence to store the original urlredirectService
- Redirection Service
-
-
Method Details
-
loginSuccess
public io.micronaut.http.MutableHttpResponse<?> loginSuccess(Authentication authentication, io.micronaut.http.HttpRequest<?> request) - Specified by:
loginSuccess
in interfaceLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>> - Parameters:
authentication
- Authenticated user's representation.request
- The HTTP Request being executed- Returns:
- An HTTP Response. Eg. a redirect or an JWT token rendered to the response
-
loginRefresh
public io.micronaut.http.MutableHttpResponse<?> loginRefresh(Authentication authentication, String refreshToken, io.micronaut.http.HttpRequest<?> request) - Specified by:
loginRefresh
in interfaceLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>> - Parameters:
authentication
- Authenticated user's representation.refreshToken
- The refresh tokenrequest
- The HTTP Request being executed- Returns:
- An HTTP Response. Eg. a redirect or an JWT token rendered to the response
-
loginFailed
public io.micronaut.http.MutableHttpResponse<?> loginFailed(AuthenticationResponse authenticationFailed, io.micronaut.http.HttpRequest<?> request) - Specified by:
loginFailed
in interfaceLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>> - Parameters:
authenticationFailed
- Object encapsulates the Login failurerequest
- The HTTP Request being executed- Returns:
- An HTTP Response. Eg. a redirect or 401 response
-
SessionLoginHandler(RedirectConfiguration, SessionStore, PriorToLoginPersistence, RedirectService, List)
instead.