Class TokenConfigurationProperties
- java.lang.Object
-
- io.micronaut.security.token.config.TokenConfigurationProperties
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable,TokenConfiguration
@ConfigurationProperties("micronaut.security.token") public class TokenConfigurationProperties extends java.lang.Object implements TokenConfigurationDefines Security Token Configuration.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ENABLEDThe default enable value.static java.lang.StringPREFIX-
Fields inherited from interface io.micronaut.security.token.config.TokenConfiguration
DEFAULT_NAME_KEY, DEFAULT_ROLES_NAME, DEFAULT_ROLES_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description TokenConfigurationProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetNameKey()Key which will be used in theAuthentication.getAttributes()for the User`s name.java.lang.StringgetRolesName()Key which will be used in theAuthentication.getAttributes()for the User`s roles.java.lang.StringgetRolesSeparator()Separator which will be used for splitting the roles before processing theAuthentication.booleanisEnabled()voidsetEnabled(boolean enabled)Sets whether the configuration is enabled.voidsetNameKey(java.lang.String nameKey)Authenticationattributes map key for the user's name.voidsetRolesName(java.lang.String rolesName)Authenticationattributes map key for the user's roles.voidsetRolesSeparator(java.lang.String rolesSeparator)If the entry used for the roles in theAuthenticationattributes map is a String, you can use the separator to split its value into multiple roles.
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
The default enable value.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable
-
getRolesName
@NonNull public java.lang.String getRolesName()
Description copied from interface:TokenConfigurationKey which will be used in theAuthentication.getAttributes()for the User`s roles.- Specified by:
getRolesNamein interfaceTokenConfiguration- Returns:
- The key used for the user's roles within the user's attributes. e.g. "roles".
- See Also:
(). If not specified, defaults to .
-
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)Authenticationattributes map key for the user's roles. Default value "roles".- Parameters:
rolesName- The roles name
-
getNameKey
@NonNull public java.lang.String getNameKey()
Description copied from interface:TokenConfigurationKey which will be used in theAuthentication.getAttributes()for the User`s name.- Specified by:
getNameKeyin interfaceTokenConfiguration- Returns:
- The key used for the user's name within the user's attributes. e.g. "sub".
- See Also:
If not specified, defaults to .
-
setNameKey
public void setNameKey(@NonNull java.lang.String nameKey)Authenticationattributes 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:TokenConfigurationSeparator which will be used for splitting the roles before processing theAuthentication.- Specified by:
getRolesSeparatorin interfaceTokenConfiguration- 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 theAuthenticationattributes map is a String, you can use the separator to split its value into multiple roles. Default value .- Parameters:
rolesSeparator- separator to split roles by
-
-