Class CookieStatePersistenceConfiguration

  • All Implemented Interfaces:
    io.micronaut.http.cookie.CookieConfiguration

    @ConfigurationProperties("micronaut.security.oauth2.state.cookie")
    public class CookieStatePersistenceConfiguration
    extends java.lang.Object
    implements io.micronaut.http.cookie.CookieConfiguration
    Since:
    1.2.0
    Author:
    James Kleeh
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PREFIX  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> getCookieDomain()  
      java.util.Optional<java.time.temporal.TemporalAmount> getCookieMaxAge()  
      java.lang.String getCookieName()  
      java.util.Optional<java.lang.String> getCookiePath()  
      java.util.Optional<java.lang.Boolean> isCookieHttpOnly()  
      java.util.Optional<java.lang.Boolean> isCookieSecure()  
      void setCookieDomain​(java.lang.String cookieDomain)
      Sets the domain name of this Cookie.
      void setCookieHttpOnly​(java.lang.Boolean cookieHttpOnly)
      Whether the Cookie can only be accessed via HTTP.
      void setCookieMaxAge​(java.time.Duration cookieMaxAge)
      Sets the maximum age of the cookie.
      void setCookieName​(java.lang.String cookieName)
      Cookie Name.
      void setCookiePath​(java.lang.String cookiePath)
      Sets the path of the cookie.
      void setCookieSecure​(java.lang.Boolean cookieSecure)
      Sets whether the cookie is secured.
      • Methods inherited from class java.lang.Object

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

      • CookieStatePersistenceConfiguration

        public CookieStatePersistenceConfiguration()
    • Method Detail

      • getCookieName

        @Nonnull
        public java.lang.String getCookieName()
        Specified by:
        getCookieName in interface io.micronaut.http.cookie.CookieConfiguration
      • setCookieName

        public void setCookieName​(@Nonnull
                                  java.lang.String cookieName)
        Cookie Name. Default value ("OAUTH2_STATE").
        Parameters:
        cookieName - Cookie name
      • getCookieDomain

        public java.util.Optional<java.lang.String> getCookieDomain()
        Specified by:
        getCookieDomain in interface io.micronaut.http.cookie.CookieConfiguration
      • setCookieDomain

        public void setCookieDomain​(@Nullable
                                    java.lang.String cookieDomain)
        Sets the domain name of this Cookie. Default value (null).
        Parameters:
        cookieDomain - the domain name of this Cookie
      • getCookiePath

        public java.util.Optional<java.lang.String> getCookiePath()
        Specified by:
        getCookiePath in interface io.micronaut.http.cookie.CookieConfiguration
      • setCookiePath

        public void setCookiePath​(@Nullable
                                  java.lang.String cookiePath)
        Sets the path of the cookie. Default value ("/").
        Parameters:
        cookiePath - The path of the cookie.
      • isCookieHttpOnly

        public java.util.Optional<java.lang.Boolean> isCookieHttpOnly()
        Specified by:
        isCookieHttpOnly in interface io.micronaut.http.cookie.CookieConfiguration
      • setCookieHttpOnly

        public void setCookieHttpOnly​(java.lang.Boolean cookieHttpOnly)
        Whether the Cookie can only be accessed via HTTP. Default value (true).
        Parameters:
        cookieHttpOnly - Whether the Cookie can only be accessed via HTTP
      • isCookieSecure

        public java.util.Optional<java.lang.Boolean> isCookieSecure()
        Specified by:
        isCookieSecure in interface io.micronaut.http.cookie.CookieConfiguration
      • setCookieSecure

        public void setCookieSecure​(java.lang.Boolean cookieSecure)
        Sets whether the cookie is secured. Default value (true).
        Parameters:
        cookieSecure - True if the cookie is secure
      • getCookieMaxAge

        public java.util.Optional<java.time.temporal.TemporalAmount> getCookieMaxAge()
        Specified by:
        getCookieMaxAge in interface io.micronaut.http.cookie.CookieConfiguration
      • setCookieMaxAge

        public void setCookieMaxAge​(java.time.Duration cookieMaxAge)
        Sets the maximum age of the cookie. Default value (5 minutes).
        Parameters:
        cookieMaxAge - The maximum age of the cookie