Class RefreshTokenConfigurationProperties
java.lang.Object
io.micronaut.security.token.jwt.generator.RefreshTokenConfigurationProperties
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
,RefreshTokenConfiguration
@Introspected
@Requires(property="micronaut.security.token.jwt.generator.refresh-token.secret") @Requires(property="micronaut.security.token.jwt.generator.refresh-token.enabled",notEquals="false")
@ConfigurationProperties("micronaut.security.token.jwt.generator.refresh-token")
public class RefreshTokenConfigurationProperties
extends Object
implements RefreshTokenConfiguration
ConfigurationProperties
implementation of RefreshTokenConfiguration
to configure SignedRefreshTokenGenerator
.- Since:
- 2.0.0
- Author:
- James Kleeh, Sergio del Amo
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default base64 value.static final boolean
The default enable value.static final com.nimbusds.jose.JWSAlgorithm
The default secure value.static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull com.nimbusds.jose.JWSAlgorithm
@NonNull String
boolean
isBase64()
boolean
void
setBase64
(boolean base64) Indicates whether the supplied secret is base64 encoded.void
setEnabled
(boolean enabled) Sets whetherSignedRefreshTokenGenerator
is enabled.void
setJwsAlgorithm
(@NonNull com.nimbusds.jose.JWSAlgorithm jwsAlgorithm) JWSAlgorithm
.void
-
Field Details
-
PREFIX
- See Also:
-
DEFAULT_JWS_ALGORITHM
public static final com.nimbusds.jose.JWSAlgorithm DEFAULT_JWS_ALGORITHMThe default secure value. -
DEFAULT_BASE64
public static final boolean DEFAULT_BASE64The default base64 value.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
-
Constructor Details
-
RefreshTokenConfigurationProperties
public RefreshTokenConfigurationProperties()
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) Sets whetherSignedRefreshTokenGenerator
is enabled. Default value (true).- Parameters:
enabled
- True if it is enabled
-
setJwsAlgorithm
public void setJwsAlgorithm(@NonNull @NonNull com.nimbusds.jose.JWSAlgorithm jwsAlgorithm) JWSAlgorithm
. Defaults to HS256- Parameters:
jwsAlgorithm
- JWS Algorithm
-
setSecret
- Parameters:
secret
- shared secret. For HS256 must be at least 256 bits.
-
setBase64
public void setBase64(boolean base64) Indicates whether the supplied secret is base64 encoded. Default value false.- Parameters:
base64
- boolean flag indicating whether the supplied secret is base64 encoded
-
getJwsAlgorithm
@NonNull public @NonNull com.nimbusds.jose.JWSAlgorithm getJwsAlgorithm()- Specified by:
getJwsAlgorithm
in interfaceRefreshTokenConfiguration
- Returns:
- JWS Algorithm
-
getSecret
- Specified by:
getSecret
in interfaceRefreshTokenConfiguration
- Returns:
- Secret used to sign the refresh token.
-
isBase64
public boolean isBase64()- Specified by:
isBase64
in interfaceRefreshTokenConfiguration
- Returns:
- true if the secret is Base64 encoded
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-