AiutaJwtAuth class
This class is used to authenticate Aiuta using JWT and subscriptionId. JWT is used to authenticate sensitive requests (such as starting virtual try-on). Other requests are authenticated with your subscriptionId. Please see Aiuta API documentation for instructions on how to get your subscription id.
Constructors
-
AiutaJwtAuth.new({required String subscriptionId, required Future<
String> getJwt(Map<String, dynamic> )}) -
Creates an AiutaJwtAuth with your
subscriptionId
andgetJwt
callback to get JWT for sensitive requests in order to access Aiuta API. -
AiutaJwtAuth.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
getJwt
→ Future<
String> Function(Map<String, dynamic> ) -
The function is used to get JWT for sensitive requests.
Return a JWT string that is not empty, a JWT is not expired or invalid.
If throws an exception or JWT is empty, the request will be rejected and
the user will be notified with "Something went wrong" message during virtual try-on.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- mode ↔ AiutaAuthMode
-
Authentication mode is used to determine the type of authentication.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subscriptionId → String
-
Subscription id is used to authenticate insecure requests.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited