Interface JwtAuthority<I>
- Type Parameters:
I- Identity type.
public interface JwtAuthority<I>
Authority for JWT.
- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptioncreateAccessToken(Object claims) Create the access token for the claims.createRefreshToken(I identity) Creates the refresh token for the identity.decodeRefreshToken(String refreshToken) Decodes the refresh token for the identity.Obtains the current activeJwtValidateKeyinstances.voidAllows manually triggering a reload of theJwtAccessKeyinstances.voidAllows manually triggering a reload of theJwtRefreshKeyinstances.
-
Method Details
-
createRefreshToken
Creates the refresh token for the identity.- Parameters:
identity- Identity.- Returns:
RefreshToken.- Throws:
RefreshTokenException- If fails to create the refresh token.
-
decodeRefreshToken
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
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
Obtains the current active
JwtValidateKeyinstances.This allows publishing the
JwtValidateKeyinstances toJwtHttpSecuritySourceimplementations.- Returns:
- Current active
JwtValidateKeyinstances. - Throws:
ValidateKeysException- If fails to retrieve the activeJwtValidateKeyinstances.
-