ftauth library

FTAuth client-side library for Dart servers and web applications.

For Flutter apps, see ftauth_flutter.

Classes

AuthFailure
An error occurred during authorization.
AuthLoading
The user's state is being retrieved or refreshed.
AuthorizationServerMetadata
Information about to the server providing authentication and authorization.
Authorizer
Handles the generic OAuth flow by interfacing with native layer components and maintaining the state of the client.
AuthorizerImpl
AuthorizerInterface
AuthSignedIn
The user is logged in with the requested privileges.
AuthSignedOut
The user is logged out or their access has expired.
AuthState
The state of authorization for the app.
Certificate
CertificateChain
Client
HTTP client which handles making authorized requests and automatically refreshes access tokens when expired.
ClientInfo
Metadata about an FTAuth client.
Config
Configuration of an OAuth client, including identifiers and URLs needed to connect to a running server instance.
Credentials
A user's access and refresh tokens plus metadata needed to access services.
CryptoRepo
CryptoRepoImpl
FTAuth
The main utility class. It is generally not necessary to work with this class directly.
FTAuthInterface
LoggerInterface
MetadataRepo
OpenIDDiscoveryData
Response data from an OIDC discovery endpoint call.
SSLPinningClient
An HTTP client which pins SSL certificates.
SSLPinningInterface
SSLRepo
SSLRepoImpl
StdoutLogger
A logger which prints all output to the console.
StorageRepo
Handles secure storage of private information retained via the OAuth process including tokens, state, and code verifiers.
Token
User
UserRepo
UserRepoInterface

Enums

CertificateType
ClientType
ConfigChangeStrategy
Strategy to use when FTAuth is configured with a new configuration (a new client ID).
Provider
The OAuth server to authorize against.
TokenFormat

Extensions

ClientTypeX on ClientType

Functions

createBasicAuthorization(String clientId, [String? clientSecret]) String
createCodeVerifier() String
Generates a random code verifier for the auth code flow.
createGrant(Config config, {String? codeVerifier, Client? httpClient}) → AuthorizationCodeGrant
Creates an authorization code grant.
generateState() String
Generates a random state parameter for the auth code flow.
restoreGrant(Config config, {required String state, String? codeVerifier, Client? httpClient}) → AuthorizationCodeGrant
Creates an authorization code grant and advances the internal state to pendingResponse so that parameter exchange will work.

Typedefs

SetupHandler = FutureOr<void> Function(FTAuth)

Exceptions / Errors

ApiException
AuthException