Library for implementing OAuth 2.0 storage using ManagedObjects.

This library contains ManagedObject subclasses to represent OAuth 2.0 artifacts and implements AuthStorage for use by an AuthServer. Usage of this library involves two tasks. First, an instance of ManagedAuthStorage is provided to an AuthServer at startup:

    var context = new ManagedContext(dataModel, store);
    var storage = new ManagedAuthStorage<User>(context)
    var authServer = new AuthServer(storage);

Then, a ManagedObject subclass that represents an OAuth 2.0 resource owner ust be declared. It must implement ManagedAuthResourceOwner. Its persistent type must implement ManagedAuthenticatable. For example, the follower User fulfills the requirement:

    class User extends ManagedObject<_User> implements _User, ManagedAuthResourceOwner  {}
    class _User extends ManagedAuthenticatable { ... }

This library must be visible from the application's library file - that is, for an application named 'foo', this library must be imported in foo/foo.dart.

This library declares two ManagedObject subclasses, ManagedToken and ManagedClient. An application using this library must ensure that these two types have corresponding database tables. The aqueduct db tool will create database tables for these types as long as they are visible to the application's library file, as noted above.

Classes

ManagedAuthenticatable

REQUIRED: Represents an OAuth 2.0 Resource Owner database table.

ManagedAuthResourceOwner

REQUIRED: An OAuth 2.0 Resource Owner as a ManagedObject.

ManagedAuthStorage

AuthStorage implementation for an AuthServer using ManagedObjects.

ManagedClient

Represent OAuth 2.0 clients.

ManagedToken

Represent an OAuth 2.0 authorization token and authorization code.