public class DefaultJwtConfiguration extends Object implements JwtConfiguration
JwtConfiguration implementation| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultJwtConfiguration.ConfigurationBuilder
Default
Builder implementation. |
JwtConfiguration.Builder, JwtConfiguration.InvalidJwtConfigurationExceptionCONTEXT_KEY| Constructor and Description |
|---|
DefaultJwtConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
long |
getExpireTime()
Get JWT token expire time.
|
Optional<String> |
getIssuer()
Get the JWT token issuer (iss)
|
Optional<Key> |
getPrivateKey()
Get the private key to be used with asymmetric JWT signature algorithms.
|
Optional<Key> |
getPublicKey()
Get the public key to be used with asymmetric JWT signature algorithms.
|
Optional<byte[]> |
getSharedKey()
Get the shared key to be used with symmetric JWT signature algorithms.
|
JwtSignatureAlgorithm |
getSignatureAlgorithm()
Get the JWT token signature algorithm.
|
boolean |
isIncludeDetails()
Get whether to include
Authentication details in JWT token at token generation time. |
boolean |
isIncludePermissions()
Get whether to include
Authentication permissions in JWT token at token generation time. |
boolean |
isNotBeforeNow()
Get whether to set the
nbf (not before) JWT claim to the timestamp at which the token is created. |
void |
setExpireTime(long expireTime)
Set JWT token expire time
|
void |
setIncludeDetails(boolean includeDetails)
Set whether to include
Authentication details in JWT token generation |
void |
setIncludePermissions(boolean includePermissions)
Set whether to include
Authentication permissions in JWT token generation |
void |
setIssuer(String issuer)
JWT token issuer
|
void |
setNotBeforeNow(boolean notBeforeNow)
Set whether to set the
nbf (not before) JWT claim to the timestamp at which the token is created. |
void |
setPrivateKey(Key privateKey)
Set JWT signing private key to use with asymmetric signing algorithms (such as RSA)
|
void |
setPublicKey(Key publicKey)
Set JWT signing public key to use with asymmetric signing algorithms (such as RSA)
|
void |
setSharedKey(byte[] sharedKey)
Set JWT signing shared key to use with symmetric signing algorithms (such as HMAC)
|
void |
setSignatureAlgorithm(JwtSignatureAlgorithm signatureAlgorithm)
Set JWT token signature algorithm
|
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitbuild, builder, getCurrentpublic Optional<String> getIssuer()
JwtConfigurationgetIssuer in interface JwtConfigurationpublic JwtSignatureAlgorithm getSignatureAlgorithm()
JwtConfigurationgetSignatureAlgorithm in interface JwtConfigurationJwtSignatureAlgorithm.NONE if the JWT token is not signedpublic Optional<byte[]> getSharedKey()
JwtConfigurationgetSharedKey in interface JwtConfigurationpublic Optional<Key> getPublicKey()
JwtConfigurationgetPublicKey in interface JwtConfigurationpublic Optional<Key> getPrivateKey()
JwtConfigurationgetPrivateKey in interface JwtConfigurationpublic long getExpireTime()
JwtConfigurationgetExpireTime in interface JwtConfiguration<=0 means token never expirespublic boolean isNotBeforeNow()
JwtConfigurationnbf (not before) JWT claim to the timestamp at which the token is created.isNotBeforeNow in interface JwtConfigurationtrue to set the nbf (not before) JWT claim to the timestamp at which the token
is createdpublic boolean isIncludeDetails()
JwtConfigurationAuthentication details in JWT token at token generation time.isIncludeDetails in interface JwtConfigurationtrue to include Authentication details in JWT token, false otherwisepublic boolean isIncludePermissions()
JwtConfigurationAuthentication permissions in JWT token at token generation time.isIncludePermissions in interface JwtConfigurationtrue to include Authentication permissions in JWT token, false
otherwisepublic void setIssuer(String issuer)
issuer - the issuer to setpublic void setSignatureAlgorithm(JwtSignatureAlgorithm signatureAlgorithm)
signatureAlgorithm - Signature algorithmpublic void setSharedKey(byte[] sharedKey)
sharedKey - the key to setpublic void setPublicKey(Key publicKey)
publicKey - the key to setpublic void setPrivateKey(Key privateKey)
privateKey - the key to setpublic void setExpireTime(long expireTime)
expireTime - Expire time in millisecondspublic void setNotBeforeNow(boolean notBeforeNow)
nbf (not before) JWT claim to the timestamp at which the token is created.notBeforeNow - true to set the nbf (not before) JWT claim to the timestamp at
which the token is created.public void setIncludeDetails(boolean includeDetails)
Authentication details in JWT token generationincludeDetails - true to include Authentication detailspublic void setIncludePermissions(boolean includePermissions)
Authentication permissions in JWT token generationincludePermissions - true to include Authentication permissionsCopyright © 2019 The Holon Platform. All rights reserved.