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 AccessTokencreateAccessToken(java.lang.Object claims)Create the access token for the claims.RefreshTokencreateRefreshToken(I identity)Creates the refresh token for the identity.IdecodeRefreshToken(java.lang.String refreshToken)Decodes the refresh token for the identity.JwtValidateKey[]getActiveJwtValidateKeys()Obtains the current activeJwtValidateKeyinstances.voidreloadAccessKeys()Allows manually triggering a reload of theJwtAccessKeyinstances.voidreloadRefreshKeys()Allows manually triggering a reload of theJwtRefreshKeyinstances.
-
-
-
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
JwtRefreshKeyinstances.This is useful for manual intervention in the active
JwtRefreshKeyinstances. For example, a compromisedJwtRefreshKeycan be removed from theJwtAuthorityRepositorywith this method invoked to reload theJwtRefreshKeyinstances (minus the deleted compromisedJwtRefreshKeyinstance).
-
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
JwtAccessKeyinstances.Similar to
reloadRefreshKeys(), except forJwtAccessKeyinstances.
-
getActiveJwtValidateKeys
JwtValidateKey[] getActiveJwtValidateKeys() throws ValidateKeysException
Obtains the current active
JwtValidateKeyinstances.This allows publishing the
JwtValidateKeyinstances toJwtHttpSecuritySourceimplementations.- Returns:
- Current active
JwtValidateKeyinstances. - Throws:
ValidateKeysException- If fails to retrieve the activeJwtValidateKeyinstances.
-
-