AuthStorage implementation for an AuthServer using ManagedObjects.
An instance of this class manages storage and retrieval of OAuth 2.0 tokens, clients and resource owners using the ManagedObjects declared in this library.
The type argument must be the application-specific resource owner that implements ManagedAuthResourceOwner.
Provide an instance of this type to an AuthServer at startup. For example, if the application has a type named User
that fulfills
ManagedAuthResourceOwner,
var context = new ManagedContext(dataModel, store);
var storage = new ManagedAuthStorage<User>(context)
var authServer = new AuthServer(storage);
- Inheritance
- Object
- AuthStorage
- ManagedAuthStorage
Constructors
- ManagedAuthStorage(ManagedContext context, { int tokenLimit: 40 })
-
Creates an instance of this type.
Properties
- context → ManagedContext
-
The ManagedContext this instance uses to store and retrieve values.
read / write - tokenLimit → int
-
The number of tokens and authorization codes a user can have at a time.
read / write - hashCode → int
-
The hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
fetchAuthCodeByCode(
AuthServer server, String code) → Future<AuthCode> -
Asks this instance to retrieve an auth code from provided
code
. -
fetchAuthenticatableByUsername(
AuthServer server, String username) → Future<T> -
Returns an
Authenticatable
for anusername
. -
fetchClientByID(
AuthServer server, String id) → Future<AuthClient> -
Returns an
AuthClient
for a client ID. -
fetchTokenByAccessToken(
AuthServer server, String accessToken) → Future<AuthToken> -
Returns a
AuthToken
for anaccessToken
. -
fetchTokenByRefreshToken(
AuthServer server, String refreshToken) → Future<AuthToken> -
Returns a
AuthToken
for anrefreshToken
. -
pruneTokens(
resourceOwnerIdentifier) → Future -
refreshTokenWithAccessToken(
AuthServer server, String oldAccessToken, String newAccessToken, DateTime newIssueDate, DateTime newExpirationDate) → Future -
Asks this instance to update an existing
AuthToken
forserver
. -
revokeAuthCodeWithCode(
AuthServer server, String code) → Future -
Asks this instance to delete an existing
AuthCode
forserver
. -
revokeAuthenticatableWithIdentifier(
AuthServer server, identifier) → Future -
This method must revoke all
AuthToken
andAuthCode
s for anAuthenticatable
. -
revokeClientWithID(
AuthServer server, String id) → Future -
Revokes an
AuthClient
for a client ID. -
revokeTokenIssuedFromCode(
AuthServer server, AuthCode code) → Future -
Deletes a
AuthToken
by its issuingAuthCode
. -
storeAuthCode(
AuthServer server, AuthCode code) → Future -
Asks this instance to store a
AuthCode
forserver
. -
storeToken(
AuthServer server, AuthToken t, { AuthCode issuedFrom }) → Future -
Asks this instance to store a
AuthToken
forserver
. -
allowedScopesForAuthenticatable(
Authenticatable authenticatable) → List<AuthScope> -
Returns list of allowed scopes for a given Authenticatable.
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited