Skip to content

A Dart library for generating OAuth 2.0 access tokens for Google APIs based on JSON service account credentials.

License

Notifications You must be signed in to change notification settings

Sevastyan/google_oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Dart library for generating OAuth 2.0 access tokens for Google APIs based on JSON service account credentials.

Usage

The package provides a flexible, extensible interface through generator functions:

final Map<String, dynamic> json = {/*content of google-services.json*/};
final scopes = [
  'https://www.googleapis.com/auth/cloud-platform',
  'https://www.googleapis.com/auth/firebase.messaging',
];
final scopesToTokenGenerator = genTokenFromJson(json);
final tokenGenerator = scopesToTokenGenerator(scopes);
final accessToken = await tokenGenerator.generate();

Don't forget to handle any errors.

About

A Dart library for generating OAuth 2.0 access tokens for Google APIs based on JSON service account credentials.

Topics

Resources

License

Stars

Watchers

Forks

Languages