Business logic for handling JWT-based access and refresh tokens.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- admin → AuthenticationTokensAdmin
-
Admin-related functions for managing authentication tokens.
final
- config ↔ AuthenticationTokenConfig
-
The current JWT authentication module configuration.
getter/setter pair
- secretsTestOverride ↔ AuthenticationTokenSecrets?
-
Secrets to the used for testing. Also affects the internally used
JwtUtil
andRefreshTokenSecretHash
getter/setter pair
Static Methods
-
authenticationHandler(
Session session, String jwtAccessToken) → Future< AuthenticationInfo?> -
Looks up the
AuthenticationInfo
belonging to thejwtAccessToken
. -
createTokens(
Session session, {required UuidValue authUserId, required Set< Scope> scopes, Map<String, dynamic> ? extraClaims, Transaction? transaction}) → Future<TokenPair> - Creates a new token pair for the given auth user.
-
destroyAllRefreshTokens(
Session session, {required UuidValue authUserId, Transaction? transaction}) → Future< void> -
Removes all refresh tokens for the given
authUserId
. -
destroyRefreshToken(
Session session, {required UuidValue refreshTokenId, Transaction? transaction}) → Future< void> - Removes a specific refresh token.
-
listAuthenticationTokens(
Session session, {required UuidValue authUserId, Transaction? transaction}) → Future< List< AuthenticationTokenInfo> > -
List all authentication tokens belonging to the given
authUserId
. -
rotateRefreshToken(
Session session, {required String refreshToken, Transaction? transaction}) → Future< TokenPair> - Returns a new refresh / access token pair.