JWTAuthentication class
JWT authentication. This class is used to authenticate Aiuta using JWT. JWT is used to authenticate sensitive requests (such as starting virtual try-on). Other requests are authenticated with your subscription id. Please see Aiuta API documentation for instructions on how to get your subscription id.
- Inheritance
-
- Object
- AiutaAuthentication
- JWTAuthentication
- Annotations
-
- @JsonSerializable()
Constructors
-
JWTAuthentication({required String subscriptionId, required Future<
String> getJWT(Map<String, dynamic> )}) - Create JWTAuthentication with subscription id and getJWT function.
-
JWTAuthentication.fromJson(Map<
String, dynamic> json) -
Factory method to create JWTAuthentication from json.
factory
Properties
-
getJWT
→ Future<
String> Function(Map<String, dynamic> ) -
The function is used to get JWT for sensitive requests.
The function should return a JWT string that is not empty, a JWT is not expired or invalid.
Otherwise, 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 ↔ AiutaAuthenticationMode
-
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> -
Method to convert JWTAuthentication to json.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited