login_client 3.2.0 copy "login_client: ^3.2.0" to clipboard
login_client: ^3.2.0 copied to clipboard

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.

18
likes
150
points
820
downloads

Publisher

verified publisherleancode.co

Weekly Downloads

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

Homepage
Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

http, http_parser, meta, oauth2

More

Packages that depend on login_client