LogtoClient class
LogtoClient
The main class for the Logto SDK. It provides all the user authentication and authorization methods.
@param config: LogtoConfig - the basic configuration object for the Logto SDK.
@param storageProvider: LogtoStorageStrategy (optional) - default is InMemoryTokenStorage
used for storing tokens.
@param httpClient: http.Client (optional) - custom http.Client
to be used for making http requests.
Example:
final config = LogtoConfig(
appId: 'oOeT50aNvY7QbLci6XJZt',
endpoint: 'http://localhost:3001/',
);
final logtoClient = LogtoClient(config);
Constructors
- LogtoClient({required LogtoConfig config, LogtoStorageStrategy? storageProvider, Client? httpClient})
Properties
- config → LogtoConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
idToken
→ Future<
String?> -
no setter
-
idTokenClaims
→ Future<
OpenIdClaims?> -
no setter
-
isAuthenticated
→ Future<
bool> -
no setter
- loading → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getAccessToken(
{String? resource, String? organizationId}) → Future< AccessToken?> -
getOrganizationToken(
String organizationId) → Future< AccessToken?> -
getUserInfo(
) → Future< LogtoUserInfoResponse> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
signIn(
String redirectUri, {InteractionMode? interactionMode, String? loginHint, String? directSignIn, FirstScreen? firstScreen, List< IdentifierType> ? identifiers, Map<String, String> ? extraParams}) → Future<void> -
signOut(
) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited