Class CookiePriorToLoginPersistence

  • All Implemented Interfaces:
    PriorToLoginPersistence

    @Requires(property="micronaut.security.redirect.prior-to-login",
              value="true")
    @Singleton
    public class CookiePriorToLoginPersistence
    extends java.lang.Object
    implements PriorToLoginPersistence
    Stores the last unauthorized URL in a cookie to redirect back to after logging in.
    Since:
    2.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configure​(io.micronaut.http.cookie.Cookie cookie, io.micronaut.http.HttpRequest<?> request)
      Configure the cookie.
      java.util.Optional<java.net.URI> getOriginalUri​(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse<?> response)  
      void onUnauthorized​(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse<?> response)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CookiePriorToLoginPersistence

        public CookiePriorToLoginPersistence​(@Nullable
                                             TokenCookieConfiguration cookieConfiguration)
    • Method Detail

      • onUnauthorized

        public void onUnauthorized​(io.micronaut.http.HttpRequest<?> request,
                                   io.micronaut.http.MutableHttpResponse<?> response)
        Specified by:
        onUnauthorized in interface PriorToLoginPersistence
      • getOriginalUri

        public java.util.Optional<java.net.URI> getOriginalUri​(io.micronaut.http.HttpRequest<?> request,
                                                               io.micronaut.http.MutableHttpResponse<?> response)
        Specified by:
        getOriginalUri in interface PriorToLoginPersistence
      • configure

        protected void configure​(io.micronaut.http.cookie.Cookie cookie,
                                 io.micronaut.http.HttpRequest<?> request)
        Configure the cookie.
        Parameters:
        cookie - The cookie
        request - The current request