Interface JwtAuthority<I>
-
- Type Parameters:
I
- Identity type.
public interface JwtAuthority<I>
Authority for JWT.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AccessToken
createAccessToken(java.lang.Object claims)
Create the access token for the claims.RefreshToken
createRefreshToken(I identity)
Creates the refresh token for the identity.I
decodeRefreshToken(java.lang.String refreshToken)
Decodes the refresh token for the identity.JwtValidateKey[]
getActiveJwtValidateKeys()
Obtains the current activeJwtValidateKey
instances.void
reloadAccessKeys()
Allows manually triggering a reload of theJwtAccessKey
instances.void
reloadRefreshKeys()
Allows manually triggering a reload of theJwtRefreshKey
instances.
-
-
-
Method Detail
-
createRefreshToken
RefreshToken createRefreshToken(I identity) throws RefreshTokenException
Creates the refresh token for the identity.- Parameters:
identity
- Identity.- Returns:
RefreshToken
.- Throws:
RefreshTokenException
- If fails to create the refresh token.
-
decodeRefreshToken
I decodeRefreshToken(java.lang.String refreshToken) throws RefreshTokenException
Decodes the refresh token for the identity.- Parameters:
refreshToken
- Refresh token.- Returns:
- Identity within the refresh token.
- Throws:
RefreshTokenException
- If fails to decode refresh token.
-
reloadRefreshKeys
void reloadRefreshKeys()
Allows manually triggering a reload of the
JwtRefreshKey
instances.This is useful for manual intervention in the active
JwtRefreshKey
instances. For example, a compromisedJwtRefreshKey
can be removed from theJwtAuthorityRepository
with this method invoked to reload theJwtRefreshKey
instances (minus the deleted compromisedJwtRefreshKey
instance).
-
createAccessToken
AccessToken createAccessToken(java.lang.Object claims) throws AccessTokenException
Create the access token for the claims.- Parameters:
claims
- Claims.- Returns:
AccessToken
.- Throws:
AccessTokenException
- If fails to create the access token.
-
reloadAccessKeys
void reloadAccessKeys()
Allows manually triggering a reload of the
JwtAccessKey
instances.Similar to
reloadRefreshKeys()
, except forJwtAccessKey
instances.
-
getActiveJwtValidateKeys
JwtValidateKey[] getActiveJwtValidateKeys() throws ValidateKeysException
Obtains the current active
JwtValidateKey
instances.This allows publishing the
JwtValidateKey
instances toJwtHttpSecuritySource
implementations.- Returns:
- Current active
JwtValidateKey
instances. - Throws:
ValidateKeysException
- If fails to retrieve the activeJwtValidateKey
instances.
-
-