@ConfigurationProperties(value="micronaut.security.token") public class TokenConfigurationProperties extends java.lang.Object implements TokenConfiguration
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static java.lang.String |
PREFIX |
DEFAULT_NAME_KEY, DEFAULT_ROLES_NAME, DEFAULT_ROLES_SEPARATOR
Constructor and Description |
---|
TokenConfigurationProperties() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNameKey()
Key which will be used in the
Authentication.getAttributes() for the User`s name. |
java.lang.String |
getRolesName()
Key which will be used in the
Authentication.getAttributes() for the User`s roles. |
java.lang.String |
getRolesSeparator()
Separator which will be used for splitting the roles before processing the
Authentication . |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled)
Sets whether the configuration is enabled.
|
void |
setNameKey(java.lang.String nameKey)
Authentication attributes map key for the user's name. |
void |
setRolesName(java.lang.String rolesName)
Authentication attributes map key for the user's roles. |
void |
setRolesSeparator(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. |
public static final java.lang.String PREFIX
public static final boolean DEFAULT_ENABLED
public boolean isEnabled()
isEnabled
in interface io.micronaut.core.util.Toggleable
@NonNull public java.lang.String getRolesName()
TokenConfiguration
Authentication.getAttributes()
for the User`s roles.getRolesName
in interface TokenConfiguration
().
If not specified, defaults to {@link #DEFAULT_ROLES_NAME}.
public void setEnabled(boolean enabled)
enabled
- True if it is enabledpublic void setRolesName(@NonNull java.lang.String rolesName)
Authentication
attributes map key for the user's roles. Default value "roles".rolesName
- The roles name@NonNull public java.lang.String getNameKey()
TokenConfiguration
Authentication.getAttributes()
for the User`s name.getNameKey
in interface TokenConfiguration
If not specified, defaults to {@link #DEFAULT_NAME_KEY}.
public void setNameKey(@NonNull java.lang.String nameKey)
Authentication
attributes map key for the user's name. Default value "sub".nameKey
- key for name@Nullable public java.lang.String getRolesSeparator()
TokenConfiguration
Authentication
.getRolesSeparator
in interface TokenConfiguration
public void setRolesSeparator(@Nullable java.lang.String rolesSeparator)
Authentication
attributes map is a String, you can use the separator to split its value into multiple roles. Default value .rolesSeparator
- separator to split roles by