BasicJwtAuth class final

Most widely used authentication system, which is most easy to integrate and secure (when compared with basic auth)

Implemented on basis of https://github.com/Tmeister/wp-api-jwt-auth wordpress plugin.

NOTE

This plugin isn't in active development and may contain lots of bugs/issues. It is recommended to use UsefulJwtAuth instead.

Inheritance

Constructors

BasicJwtAuth({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

authorize() Future<bool>
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_UNTIL_TOKEN_EXPIRY → const int