login_client 1.0.0
login_client: ^1.0.0 copied to clipboard

Dart native js
Flutter Android iOS Linux macOS web Windows

OAuth2 compliant login client that stores credentials for the currently authenticated user and automatically refreshes tokens.

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.

4
likes
90
pub points
56%
popularity

Publisher

leancode.pl

OAuth2 compliant login client that stores credentials for the currently authenticated user and automatically refreshes tokens.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

http, http_parser, meta, oauth2

More

Packages that depend on login_client