Class SecuritySessionConfigurationProperties

    • Field Detail

      • DEFAULT_ENABLED

        public static final boolean DEFAULT_ENABLED
        The default enable value.
        See Also:
        Constant Field Values
      • DEFAULT_LOGINSUCCESSTARGETURL

        public static final java.lang.String DEFAULT_LOGINSUCCESSTARGETURL
        The default login success target URL.
        See Also:
        Constant Field Values
      • DEFAULT_LOGINFAILURETARGETURL

        public static final java.lang.String DEFAULT_LOGINFAILURETARGETURL
        The default login failure target URL.
        See Also:
        Constant Field Values
      • DEFAULT_LOGOUTTARGETURL

        public static final java.lang.String DEFAULT_LOGOUTTARGETURL
        The default login target URL.
        See Also:
        Constant Field Values
      • DEFAULT_LEGACYREJECTIONHANDLER

        @Deprecated
        public static final boolean DEFAULT_LEGACYREJECTIONHANDLER
        Deprecated.
        The default value to disable rejection handler.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SecuritySessionConfigurationProperties

        public SecuritySessionConfigurationProperties()
    • Method Detail

      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface io.micronaut.core.util.Toggleable
      • getLoginSuccessTargetUrl

        public java.lang.String getLoginSuccessTargetUrl()
        Specified by:
        getLoginSuccessTargetUrl in interface SecuritySessionConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after a successful login.
      • getLogoutTargetUrl

        public java.lang.String getLogoutTargetUrl()
        Specified by:
        getLogoutTargetUrl in interface SecuritySessionConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after logout.
      • getLoginFailureTargetUrl

        public java.lang.String getLoginFailureTargetUrl()
        Specified by:
        getLoginFailureTargetUrl in interface SecuritySessionConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after a failed login.
      • getUnauthorizedTargetUrl

        public java.lang.String getUnauthorizedTargetUrl()
        Specified by:
        getUnauthorizedTargetUrl in interface SecuritySessionConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after trying to access a secured route.
      • getForbiddenTargetUrl

        public java.lang.String getForbiddenTargetUrl()
        Specified by:
        getForbiddenTargetUrl in interface SecuritySessionConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after trying to access a secured route for which the does not have sufficient roles.
      • setLoginSuccessTargetUrl

        public void setLoginSuccessTargetUrl​(java.lang.String loginSuccessTargetUrl)
        Sets the login success target URL. Default value ("/").
        Parameters:
        loginSuccessTargetUrl - The URL
      • setLoginFailureTargetUrl

        public void setLoginFailureTargetUrl​(java.lang.String loginFailureTargetUrl)
        Sets the login failure target URL. Default value ("/").
        Parameters:
        loginFailureTargetUrl - The URL
      • setLogoutTargetUrl

        public void setLogoutTargetUrl​(java.lang.String logoutTargetUrl)
        Sets the logout target URL. Default value ("/").
        Parameters:
        logoutTargetUrl - The URL
      • setUnauthorizedTargetUrl

        public void setUnauthorizedTargetUrl​(java.lang.String unauthorizedTargetUrl)
        Sets the unauthorized target URL.
        Parameters:
        unauthorizedTargetUrl - The URL
      • setForbiddenTargetUrl

        public void setForbiddenTargetUrl​(java.lang.String forbiddenTargetUrl)
        Sets the forbidden target URL.
        Parameters:
        forbiddenTargetUrl - The URL
      • setEnabled

        public void setEnabled​(boolean enabled)
        Sets whether the session config is enabled. Default value (false).
        Parameters:
        enabled - True if it is enabled
      • getUnauthorizedRedirectUri

        public java.util.Optional<java.lang.String> getUnauthorizedRedirectUri()
        Returns:
        A uri to redirect to when a user tries to access a secured resource without authentication.
      • getUnauthorizedRedirectUri

        public java.util.Optional<java.lang.String> getUnauthorizedRedirectUri​(io.micronaut.http.HttpRequest<?> request)
        Specified by:
        getUnauthorizedRedirectUri in interface UnauthorizedRejectionUriProvider
        Parameters:
        request - HttpRequest being processed
        Returns:
        A uri to redirect to when a user tries to access a secured resource without authentication.
      • getForbiddenRedirectUri

        public java.util.Optional<java.lang.String> getForbiddenRedirectUri()
        Returns:
        A uri to redirect to when an authenticated user tries to access a resource for which he does not have the required authorization level.
      • getForbiddenRedirectUri

        public java.util.Optional<java.lang.String> getForbiddenRedirectUri​(io.micronaut.http.HttpRequest<?> request)
        Specified by:
        getForbiddenRedirectUri in interface ForbiddenRejectionUriProvider
        Parameters:
        request - HttpRequest being processed
        Returns:
        A uri to redirect to when an authenticated user tries to access a resource for which he does not have the required authorization level.