Class SecurityConfigurationProperties

    • Field Detail

      • DEFAULT_ENABLED

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

        public static final boolean DEFAULT_INTERCEPT_URL_MAP_PREPEND_PATTERN_WITH_CONTEXT_PATH
        The default value whether intercept url patterns should be prepended with the context path.
        See Also:
        Constant Field Values
      • DEFAULT_AUTHENTICATION_STRATEGY

        public static final AuthenticationStrategy DEFAULT_AUTHENTICATION_STRATEGY
        The default enable value.
      • DEFAULT_REJECT_NOT_FOUND

        public static final boolean DEFAULT_REJECT_NOT_FOUND
        The default reject-not-found value.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SecurityConfigurationProperties

        public SecurityConfigurationProperties()
    • Method Detail

      • setAuthentication

        public void setAuthentication​(@Nullable
                                      AuthenticationMode authentication)
        Defines which authentication to use. Defaults to null. Possible values bearer, session, cookie, idtoken. Should only be supplied if the service handles login and logout requests.
        Parameters:
        authentication - Login Handler Mode
      • isEnabled

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

        public java.util.List<java.lang.String> getIpPatterns()
        Specified by:
        getIpPatterns in interface SecurityConfiguration
        Returns:
        a list of IP Regex patterns. e.g. [192.168.1.*]
      • setEnabled

        public void setEnabled​(boolean enabled)
        If Security is enabled. Default value true
        Parameters:
        enabled - True if security is enabled
      • setInterceptUrlMapPrependPatternWithContextPath

        public void setInterceptUrlMapPrependPatternWithContextPath​(boolean interceptUrlMapPrependPatternWithContextPath)
        Whether the intercept URL patterns should be prepended with context path if defined. Defaults to false.
        Parameters:
        interceptUrlMapPrependPatternWithContextPath - Prepend Intercept URL Map pattern with context path
      • setInterceptUrlMap

        public void setInterceptUrlMap​(java.util.List<InterceptUrlMapPattern> interceptUrlMap)
        Map that defines the interception patterns.
        Parameters:
        interceptUrlMap - The intercept urls maps
      • setIpPatterns

        public void setIpPatterns​(java.util.List<java.lang.String> ipPatterns)
        Allowed IP patterns. Default value (["0.0.0.0"])
        Parameters:
        ipPatterns - The IP patterns
      • setAuthenticationProviderStrategy

        public void setAuthenticationProviderStrategy​(AuthenticationStrategy authenticationProviderStrategy)
        Determines how authentication providers should be processed. Default value ANY. Possible values: ANY or ALL.
        Parameters:
        authenticationProviderStrategy - authentication strategy.
      • isRejectNotFound

        public boolean isRejectNotFound()
        Description copied from interface: SecurityConfiguration
        For cases where no security rule handles a request and it is determined that the request does not match any routes on the server, whether the response should be to reject the request or allow the not found response to be returned.
        Specified by:
        isRejectNotFound in interface SecurityConfiguration
        Returns:
        True if the response should be rejected.
      • setRejectNotFound

        public void setRejectNotFound​(boolean rejectNotFound)
        Parameters:
        rejectNotFound - Whether the server should respond with 401 for requests that do not match any routes on the server, if you set it to false, it will return 404 for requests that do not match any routes on the server. Default value (true).