jaguar_auth 0.11.1 jaguar_auth: ^0.11.1 copied to clipboard
Authentication interceptors and helper functions for Jaguar
jaguar_auth #
Authentication interceptors and helper functions for Jaguar. This package builds on
Session
infrastructure provided
by jaguar
.
This package provides three types of authentication:
And an Authorizer
User model #
AuthorizationUser
is the base class user models must implement to work with authenticators,
Authorizer
and AuthModelManager
.
AuthorizationUser
demands that the model implements a getter named authorizationId
that uniquely identifies the model.
Typically, email, username or user id is used as authorizationId
to uniquely identify user models.
Example #
The following user model User
uses user id as authorizationId
. Notice that User
implements
AuthorizationUser
interface.
class User implements AuthorizationUser {
String id;
String username;
String password;
User(this.id, this.username, this.password);
String get authorizationId => id;
}
Model manager #
AuthModelManager
is used by authenticators and authorizer to fetch and authenticate the user model.
TODO
Authorizer #
TODO
Basic auth #
BasicAuth performs authentication based on basic authentication.
It expects base64 encoded "username:password" pair in "authorization" header with "Basic" scheme.
TODO
Form auth #
TODO
Json auth #
TODO