Auth3Login class

The Auth3Login class provides a simple and secure mean to provide login functionalities to any Flutter application.

Constructors

Auth3Login({String? projectId, required String clientId, String callbackUri = 'auth3://callback', String webCallbackUri = ''})
Initialize a new instance of the Auth3Login widget. projectId is optional, and if omitted it's obtained from

Properties

accessToken String
Access the stored access token. This will be an empty string if isAuthenticated is false.
no setter
callbackUri String
The callback at which Auth3 should return the token to (mobile platform). For most apps you can leave the default which is auth3://callback, this must be registered as a Client's authorized Post Login Redirect URI on the Auth3 Console.
final
clientId String
Provide a client capable of performing the Implicit flow. If you need further help please refer to the official documentation available here: https://docs.auth3.dev/products/identity-platform/authenticate-users-in-a-mobile-application
final
hashCode int
The hash code for this object.
no setterinherited
idToken String
Access the stored id token. This will be an empty string if isAuthenticated is false.
no setter
isAuthenticated bool
Returns a boolean indicating if we hold information about the current user. Can be used to detect if the user is authenticated, but please note that the presence of a token does not imply it's valid (for example it might be revoked or expired).
no setter
projectId String?
The Auth3 project ID. You can find this in the Console (https://console.auth3.dev) under "Settings" > "Endpoints". If omitted, internally we'll try to detect it automatically.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage → FlutterSecureStorage
final
webCallbackUri String
The callback at which Auth3 should return the token to (web platform). This is a way to avoid linking Universal Links. We'll just provide a web callback uri here that will be used on the web, so mobile apps can keep using Deep Links with custom protocols separately without the need to use Universal Links. "${window.location.protocol}//${window.location.host}/callback.html" note that this will require you create a callback.html with the following content (also register all valid Redirect URIs on the Console, editing your Client Security settings):
getter/setter pair

Methods

getPlatformSpecificURI() Future<String>
getProfile() Map<String, dynamic>
Access current user profile. The exact payload depends on your user ID Schema. For this to return something you will need to retrieve an ID Token. If for some reason you can't, you should instead use the /userinfo endpoint.
login({String responseType = 'id_token token', List<String> scope = const ['openid'], Map<String, String>? additionalParams}) Future<void>
Prompt the user to log-in. By default the response type is set to return an access token and ID Token, and scope is set to "openid", which upgrades the protocol to an OIDC flow. You can specify additional parameters to the authorization request using the additionalParams argument.
logout() Future<void>
Log out the user, whenever possible, using Single Logout. This will clear internal data and perform a logout on the Auth3 Identity Platform if you performed an OpenID Connect login.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restore() Future<bool>
Try to restore the session from a previous existing session rather than display the Login modal again. This is never performed automatically by the library but should be done by all applications when the user resumes an app to avoid unneeded round-trips to the Authorization Server.
toString() String
A string representation of this object.
inherited

Operators

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