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);
- Implements
-
- AuthStorage
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
Authenticatablefor anusername. -
fetchClientByID(
AuthServer server, String id) → Future<AuthClient> -
Returns an
AuthClientfor a client ID. -
fetchTokenByAccessToken(
AuthServer server, String accessToken) → Future<AuthToken> -
Returns a
AuthTokenfor anaccessToken. -
fetchTokenByRefreshToken(
AuthServer server, String refreshToken) → Future<AuthToken> -
Returns a
AuthTokenfor anrefreshToken. -
pruneTokens(
resourceOwnerIdentifier) → Future -
refreshTokenWithAccessToken(
AuthServer server, String oldAccessToken, String newAccessToken, DateTime newIssueDate, DateTime newExpirationDate) → Future -
Asks this instance to update an existing
AuthTokenforserver. -
revokeAuthCodeWithCode(
AuthServer server, String code) → Future -
Asks this instance to delete an existing
AuthCodeforserver. -
revokeAuthenticatableWithIdentifier(
AuthServer server, identifier) → Future -
This method must revoke all
AuthTokenandAuthCodes for anAuthenticatable. -
revokeClientWithID(
AuthServer server, String id) → Future -
Revokes an
AuthClientfor a client ID. -
revokeTokenIssuedFromCode(
AuthServer server, AuthCode code) → Future -
Deletes a
AuthTokenby its issuingAuthCode. -
storeAuthCode(
AuthServer server, AuthCode code) → Future -
Asks this instance to store a
AuthCodeforserver. -
storeToken(
AuthServer server, AuthToken t, { AuthCode issuedFrom }) → Future -
Asks this instance to store a
AuthTokenforserver. -
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