Class TokenConfigurationProperties

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

    @ConfigurationProperties("micronaut.security.token")
    public class TokenConfigurationProperties
    extends java.lang.Object
    implements TokenConfiguration
    Defines Security Token Configuration.
    Since:
    1.0
    • Constructor Detail

      • TokenConfigurationProperties

        public TokenConfigurationProperties()
    • Method Detail

      • isEnabled

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

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

        public void setRolesName​(@NonNull
                                 java.lang.String rolesName)
        Authentication attributes map key for the user's roles. Default value "roles".
        Parameters:
        rolesName - The roles name
      • setNameKey

        public void setNameKey​(@NonNull
                               java.lang.String nameKey)
        Authentication attributes map key for the user's name. Default value "sub".
        Parameters:
        nameKey - key for name
      • getRolesSeparator

        @Nullable
        public java.lang.String getRolesSeparator()
        Description copied from interface: TokenConfiguration
        Separator which will be used for splitting the roles before processing the Authentication.
        Specified by:
        getRolesSeparator in interface TokenConfiguration
        Returns:
        The separator used for splitting the users roles
      • setRolesSeparator

        public void setRolesSeparator​(@Nullable
                                      java.lang.String rolesSeparator)
        If the entry used for the roles in the Authentication attributes map is a String, you can use the separator to split its value into multiple roles. Default value TokenConfiguration.DEFAULT_ROLES_SEPARATOR.
        Parameters:
        rolesSeparator - separator to split roles by