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

outdated

Flutter library for interacting with standard or custom OAuth2 servers. Provides convenience classes for secure token storage and automatic token refeshing.

example/example.dart

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

class Oauth2ClientExample {
  Oauth2ClientExample();

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

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

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

    print(resp.body);
  }
}
183
likes
0
points
39.8k
downloads

Publisher

verified publisherteranet.it

Weekly Downloads

Flutter library for interacting with standard or custom OAuth2 servers. Provides convenience classes for secure token storage and 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