logto_core library

Enums

FirstScreen
The first screen to be shown in the sign-in experience.
IdentifierType
The type of the identifier supported by Logto. This field is used along with FirstScreen to specify the first screen to be shown in the sign-in experience. If specified, the first screen will be shown based on the identifier type.
InteractionMode
@Deprecated use firstScreen instead
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}) 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, String prompt = _prompt, List<String>? scopes, List<String>? resources, String? loginHint, InteractionMode? interactionMode, String? directSignIn, FirstScreen? firstScreen, List<IdentifierType>? identifiers, Map<String, String>? extraParams}) 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
isValidDirectSignInFormat(String? directSignIn) bool
Verify the direct sign-in parameter format.
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