logto_dart_sdk library

Enums

InteractionMode
By default Logto use sign-in as the landing page for the user. Use this enum to specify the interaction mode.
LogtoAuthExceptions
LogtoReservedResource
Resources that reserved by Logto, which cannot be defined by users.
LogtoUserScope
Scopes for ID Token and Userinfo Endpoint.

Constants

authorizationCodeGrantType → const String
discoveryPath → const String
organizationUrnPrefix → const String
The prefix of organization URN(Uniform Resource Name)for the organization in Logto. @example urn:logto:organization:org_1234 @see {@link https://en.wikipedia.org/wiki/Uniform_Resource_Name | Uniform Resource Name}
refreshTokenGrantType → const String

Properties

reservedScopes Set<String>
getter/setter pair

Functions

buildOrganizationUrn(String organizationId) String
Build the organization URN from organization ID.
fetchOidcConfig(Client httpClient, String endpoint) Future<OidcProviderConfig>
Fetch the OIDC provider configuration.
fetchTokenByAuthorizationCode({required Client httpClient, required String tokenEndPoint, required String code, required String codeVerifier, required String clientId, required String redirectUri, String? resource}) Future<LogtoCodeTokenResponse>
Fetch token using the authorization code.
fetchTokenByRefreshToken({required Client httpClient, required String tokenEndPoint, required String clientId, required String refreshToken, String? resource, String? organizationId, List<String>? scopes}) Future<LogtoRefreshTokenResponse>
Fetch token using the refresh token.
fetchUserInfo({required Client httpClient, required String userInfoEndpoint, required String accessToken}) Future<LogtoUserInfoResponse>
Fetch user info using the access token.
generateSignInUri({required String authorizationEndpoint, required dynamic clientId, required String redirectUri, required String codeChallenge, required String state, List<String>? scopes, List<String>? resources, InteractionMode? interactionMode, String prompt = _prompt}) Uri
Generate the sign-in URI (Authorization URI). This URI will be used to initiate the OIDC authentication flow.
generateSignOutUri({required String endSessionEndpoint, required String clientId, Uri? postLogoutRedirectUri}) Uri
Generate the sign-out URI (End Session URI).
getOrganizationIdFromUrn(String organizationUrn) String
revoke({required Client httpClient, required String revocationEndpoint, required String clientId, required String token}) Future<void>
Revoke the token.
verifyAndParseCodeFromCallbackUri(String callbackUri, String redirectUri, String state) String
A utility function to verify and parse the code from the authorization callback URI.

Exceptions / Errors

LogtoAuthException