Jwt class
Business logic for handling JWT-based access and refresh tokens.
Constructors
Properties
- admin → JwtAdmin
-
Admin-related functions for managing authentication tokens.
final
- authUsers → AuthUsers
-
Management functions for auth users.
final
- config → JwtConfig
-
The current JWT authentication module configuration.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- jwtUtil → JwtUtil
-
The JWT utility.
final
- refreshTokenSecretHash → Argon2HashUtil
-
The refresh token secret hash utility.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
authenticationHandler(
Session session, String jwtAccessToken) → Future< AuthenticationInfo?> -
Looks up the
AuthenticationInfobelonging to thejwtAccessToken. -
createTokens(
Session session, {required UuidValue authUserId, required String method, Set< Scope> ? scopes, Map<String, dynamic> ? extraClaims, bool skipUserBlockedChecked = false, Transaction? transaction}) → Future<AuthSuccess> - Creates a new token pair for the given auth user.
-
listJwtTokens(
Session session, {UuidValue? authUserId, Transaction? transaction, String? method, int limit = 100, int offset = 0}) → Future< List< JwtTokenInfo> > - List all JWT tokens matching the given filters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshAccessToken(
Session session, {required String refreshToken, Transaction? transaction}) → Future< AuthSuccess> - Returns a access token while also rotating the refresh token.
-
revokeAllRefreshTokens(
Session session, {required UuidValue authUserId, Transaction? transaction}) → Future< List< UuidValue> > -
Revokes all refresh tokens for the given
authUserId. -
revokeRefreshToken(
Session session, {required UuidValue refreshTokenId, Transaction? transaction}) → Future< bool> - Revokes a specific refresh token.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited