ManagedAuthStorage<T extends ManagedAuthResourceOwner> class

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);


ManagedAuthStorage(ManagedContext context, { int tokenLimit: 40 })
Creates an instance of this type. [...]


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


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 an username. [...]
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 an accessToken. [...]
fetchTokenByRefreshToken(AuthServer server, String refreshToken) Future<AuthToken>
Returns a AuthToken for an refreshToken. [...]
pruneTokens(dynamic resourceOwnerIdentifier) Future
refreshTokenWithAccessToken(AuthServer server, String oldAccessToken, String newAccessToken, DateTime newIssueDate, DateTime newExpirationDate) Future
Asks this instance to update an existing AuthToken for server. [...]
revokeAuthCodeWithCode(AuthServer server, String code) Future
Asks this instance to delete an existing AuthCode for server. [...]
revokeAuthenticatableWithIdentifier(AuthServer server, dynamic identifier) Future
This method must revoke all AuthToken and AuthCodes for an Authenticatable. [...]
revokeClientWithID(AuthServer server, String id) Future
Revokes an AuthClient for a client ID. [...]
revokeTokenIssuedFromCode(AuthServer server, AuthCode code) Future
Deletes a AuthToken by its issuing AuthCode. [...]
storeAuthCode(AuthServer server, AuthCode code) Future
Asks this instance to store a AuthCode for server. [...]
storeToken(AuthServer server, AuthToken t, { AuthCode issuedFrom }) Future
Asks this instance to store a AuthToken for server. [...]
allowedScopesForAuthenticatable(Authenticatable authenticatable) List<AuthScope>
Returns list of allowed scopes for a given Authenticatable. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
Returns a string representation of this object.


operator ==(dynamic other) bool
The equality operator. [...]