IAuthorization class abstract base

Base class for all authorization types.

To implement a custom authorization system, You must extend this class.

Note that, there is no storage system internally to store and retrive

Implementers

Constructors

IAuthorization({required String userName, required String password, String headerKey = 'Authorization', WordpressEvents? events})
Creates a new instance of IAuthorization with the given username and password.

Properties

baseUrl Uri
The base url of the wordpress site.
latefinal
events WordpressEvents?
The events to listen to.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headerKey String
The header key to use for authorization.
final
isDefault bool
Gets if this is an invalid or default authorization instance without username or password fields.
no setter
isValidAuth bool
Gets if this authorization instance has valid authentication nounce. (token/encryptedToken)
no setter
password String
The password
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheme String
Gets the authorization scheme.
no setter
userName String
The username
final

Methods

authorize() Future<bool>
Called to authorize a request if the request requires authentication.
clientFactoryProvider(Dio client) → void
Provides this instance of IAuthorization with the Dio client instance for requests.
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.
initialize({required Uri baseUrl}) Future<bool>
Helps to initialize authorization instance with internal requesting client passed as a parameter.
isAuthenticated() Future<bool>
Called to check if this instance has a valid authentication nounce and generateAuthUrl() won't return null.
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)

Operators

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