Class RedirectConfigurationProperties

  • All Implemented Interfaces:
    io.micronaut.core.util.Toggleable, RedirectConfiguration

    @ConfigurationProperties("micronaut.security.redirect")
    public class RedirectConfigurationProperties
    extends java.lang.Object
    implements RedirectConfiguration
    ConfigurationProperties implementation of RedirectConfiguration.
    Since:
    2.0.0
    • Field Detail

      • DEFAULT_ENABLED

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

        public static final java.lang.String DEFAULT_LOGOUT_URL
        The default logout URL.
        See Also:
        Constant Field Values
      • DEFAULT_LOGIN_SUCCESS

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

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

        public static final boolean DEFAULT_PRIOR_TO_LOGIN
        The default behavior of redirect to the uri prior to login.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RedirectConfigurationProperties

        public RedirectConfigurationProperties()
    • Method Detail

      • getLoginSuccess

        @NonNull
        public java.lang.String getLoginSuccess()
        Specified by:
        getLoginSuccess in interface RedirectConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after a successful login.
      • getLoginFailure

        @NonNull
        public java.lang.String getLoginFailure()
        Specified by:
        getLoginFailure in interface RedirectConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after a failed login.
      • setLoginSuccess

        public void setLoginSuccess​(@NonNull
                                    java.lang.String loginSuccess)
        Where the user is redirected to after a successful login. Default value ("/").
        Parameters:
        loginSuccess - The URL
      • setLoginFailure

        public void setLoginFailure​(@NonNull
                                    java.lang.String loginFailure)
        Where the user is redirected to after a failed login. Default value ("/").
        Parameters:
        loginFailure - The URL
      • getLogout

        @NonNull
        public java.lang.String getLogout()
        Specified by:
        getLogout in interface RedirectConfiguration
        Returns:
        String to be parsed into a URI which represents where the user is redirected to after logout.
      • setLogout

        public void setLogout​(@NonNull
                              java.lang.String logout)
        URL where the user is redirected after logout. Default value ("/").
        Parameters:
        logout - The URL
      • setPriorToLogin

        public void setPriorToLogin​(boolean priorToLogin)
        If true, the user should be redirected back to the unauthorized request that initiated the login flow. Supersedes the login-success configuration for those cases. Default value false.
        Parameters:
        priorToLogin - Prior to login setting
      • isPriorToLogin

        public boolean isPriorToLogin()
        Specified by:
        isPriorToLogin in interface RedirectConfiguration
        Returns:
        If the user attempted to access a URL while unauthenticated, and was subsequently redirected to login, redirect back to that URL post login (true). Use the static login success URL (false).
      • isEnabled

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

        public void setEnabled​(boolean enabled)
        Sets whether Redirection configuration enabled. Default value (true).
        Parameters:
        enabled - True if it is