KeycloakWrapper class

A wrapper around the Keycloak authentication service.

Provides functionalities for user authentication, token management, and resource authorization.

Constructors

KeycloakWrapper.new({required KeycloakConfig config})
factory

Properties

accessToken String?
Returns the access token string.
no setter
authenticationStream Stream<bool>
The stream of the user authentication state.
no setter
hashCode int
The hash code for this object.
no setterinherited
idToken String?
Returns the id token string.
no setter
isInitialized bool
Whether this package has been initialized.
no setter
onError ↔ void Function(String message, Object error, StackTrace stackTrace)
Called whenever an error gets caught.
getter/setter pair
refreshToken String?
Returns the refresh token string.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokenResponse ↔ TokenResponse?
The details from making a successful token exchange.
getter/setter pair

Methods

getUserInfo() Future<Map<String, dynamic>?>
Retrieves the current user information.
initialize() Future<void>
Initializes the user authentication state and refreshes the token.
login() Future<bool>
Logs the user in.
logout() Future<bool>
Logs the user out.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateToken([Duration? duration]) Future<void>
Requests a new access token if it expires within the given duration.

Operators

operator ==(Object other) bool
The equality operator.
inherited