login_client

login_client pub.dev badge

OAuth2 compliant login client that:

  • stores credentials for the currently authenticated user,
  • automatically refreshes tokens,
  • is easily pluggable into existing codebases.

Usage

final loginClient = LoginClient(
  oAuthSettings: OAuthSettings(
    authorizationUri: apiUri.resolve('/auth'),
    clientId: 'pl.leancode.sample_app',
  ),
  credentialsStorage: const FlutterSecureCredentialsStorage(),
);

await loginClient.logIn(
  //                                       my secret pwd
  ResourceOwnerPasswordStrategy('Albert221', 'ny4ncat'),
);

final response = await loginClient.get('/secret-stuff');

Flutter

For Flutter implementation of the CredentialsStorage, check out login_client_flutter.

Libraries

login_client
An OAuth2 compliant login client library.