UsefulJwtAuth class final
Similar to BasicJwtAuth, this plugin is in active development and has much more features than the previous one. It is recommended to use this plugin instead of the previous one.
Implemented on basis of https://github.com/usefulteam/jwt-auth wordpress plugin.
- Inheritance
-
- Object
- IAuthorization
- UsefulJwtAuth
Constructors
- UsefulJwtAuth({required String userName, required String password, WordpressEvents? events})
Properties
- baseUrl ↔ Uri
-
The base url of the wordpress site.
latefinalinherited
- events ↔ WordpressEvents?
-
The events to listen to.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerKey → String
-
The header key to use for authorization.
finalinherited
- isDefault → bool
-
Gets if this is an invalid or default authorization instance without username or password fields.
no setterinherited
- isValidAuth → bool
-
Gets if this authorization instance has valid authentication nounce. (token/encryptedToken)
no setteroverride
- password → String
-
The password
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scheme → String
-
Gets the authorization scheme.
no setteroverride
- userName → String
-
The username
finalinherited
Methods
-
Called to authorize a request if the request requires authentication.
override
-
clientFactoryProvider(
Dio client) → void -
Provides this instance of IAuthorization with the Dio client instance for requests.
override
-
generateAuthUrl(
) → Future< String?> -
After
authorize()
is called, to get the authorization header string, (ie, '{scheme} {token}') the client calls this method to generate the raw string.override -
initialize(
{required Uri baseUrl}) → Future< bool> -
Helps to initialize authorization instance with internal requesting client passed as a parameter.
inherited
-
isAuthenticated(
) → Future< bool> -
Called to check if this instance has a valid authentication nounce and generateAuthUrl() won't return null.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → Future< bool> -
Called to validate token. (such as in JWT auth)
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- DAYS_UNTILS_TOKEN_EXPIRY → const int