oauth2_client 2.2.2 copy "oauth2_client: ^2.2.2" to clipboard
oauth2_client: ^2.2.2 copied to clipboard

outdated

Flutter library for interacting with OAuth2 servers, with classes for transparent authorized requests, secure OAuth token storage, automatic token refeshing.

example/example.dart

import 'package:oauth2_client/oauth2_helper.dart';
import 'package:oauth2_client/google_oauth2_client.dart';

class Oauth2ClientExample {
  Oauth2ClientExample();

  Future<void> fetchFiles() async {
    var hlp = OAuth2Helper(GoogleOAuth2Client(
        redirectUri: 'com.teranet.app:/oauth2redirect',
        customUriScheme: 'com.teranet.app'));

    hlp.setAuthorizationParams(
        grantType: OAuth2Helper.AUTHORIZATION_CODE,
        clientId: 'XXX-XXX-XXX',
        clientSecret: 'XXX-XXX-XXX',
        scopes: ['https://www.googleapis.com/auth/drive.readonly']);

    var resp = await hlp.get('https://www.googleapis.com/drive/v3/files');

    print(resp.body);
  }
}
165
likes
0
pub points
95%
popularity

Publisher

verified publisherteranet.it

Flutter library for interacting with OAuth2 servers, with classes for transparent authorized requests, secure OAuth token storage, automatic token refeshing.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, flutter, flutter_secure_storage, flutter_web_auth, http, meta, random_string

More

Packages that depend on oauth2_client