login_client 1.1.2
login_client: ^1.1.2 copied to clipboard
OAuth2 compliant login client that stores credentials for the currently authenticated user and automatically refreshes tokens.
login_client #
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
.