@Requires(property="micronaut.security.authentication", value="idtoken") @Singleton public class IdTokenLoginHandler extends CookieLoginHandler
CookieLoginHandler
`s cookie value to the idtoken received from an authentication provider.
The cookie expiration is set to the expiration of the IDToken exp claim.accessTokenCookieConfiguration, loginFailure, loginSuccess, priorToLoginPersistence, refresh
Constructor and Description |
---|
IdTokenLoginHandler(AccessTokenCookieConfiguration accessTokenCookieConfiguration,
RedirectConfiguration redirectConfiguration,
PriorToLoginPersistence priorToLoginPersistence) |
Modifier and Type | Method and Description |
---|---|
protected java.time.Duration |
cookieExpiration(Authentication authentication,
io.micronaut.http.HttpRequest<?> request) |
java.util.List<io.micronaut.http.cookie.Cookie> |
getCookies(Authentication authentication,
io.micronaut.http.HttpRequest<?> request)
Return the cookies for the given parameters.
|
java.util.List<io.micronaut.http.cookie.Cookie> |
getCookies(Authentication authentication,
java.lang.String refreshToken,
io.micronaut.http.HttpRequest<?> request)
Return the cookies for the given parameters.
|
protected java.util.Optional<java.lang.String> |
parseIdToken(Authentication authentication) |
applyCookies, createRefreshResponse, createSuccessResponse, loginFailed, loginRefresh, loginSuccess
public IdTokenLoginHandler(AccessTokenCookieConfiguration accessTokenCookieConfiguration, RedirectConfiguration redirectConfiguration, @Nullable PriorToLoginPersistence priorToLoginPersistence)
public java.util.List<io.micronaut.http.cookie.Cookie> getCookies(Authentication authentication, io.micronaut.http.HttpRequest<?> request)
getCookies
in class CookieLoginHandler
authentication
- The Authenticated user's representationrequest
- The current requestpublic java.util.List<io.micronaut.http.cookie.Cookie> getCookies(Authentication authentication, java.lang.String refreshToken, io.micronaut.http.HttpRequest<?> request)
getCookies
in class CookieLoginHandler
authentication
- The Authenticated user's representationrefreshToken
- The access refresh tokenrequest
- The current requestprotected java.util.Optional<java.lang.String> parseIdToken(Authentication authentication)
authentication
- User Detailsprotected java.time.Duration cookieExpiration(Authentication authentication, io.micronaut.http.HttpRequest<?> request)
authentication
- User Detailsrequest
- The current request