Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deftomat/just_google_jwt_decoder
A Google JWT decoder library for Dart.
https://github.com/deftomat/just_google_jwt_decoder
dart google-jwt google-signin jwt server
Last synced: 17 days ago
JSON representation
A Google JWT decoder library for Dart.
- Host: GitHub
- URL: https://github.com/deftomat/just_google_jwt_decoder
- Owner: deftomat
- License: other
- Created: 2016-10-30T13:14:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T07:19:17.000Z (over 7 years ago)
- Last Synced: 2024-10-13T11:44:02.189Z (about 1 month ago)
- Topics: dart, google-jwt, google-signin, jwt, server
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/just_google_jwt_decoder
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Just Google JWT decoder
A simple Google JWT decoder library for Dart with all necessary verifiers.
## Usage
```dart
import 'package:just_google_jwt_decoder/just_google_jwt_decoder.dart';main() async {
var clientId = '';
var decoder = new GoogleJwtDecoder(clientId, expirationTolerance: const Duration(seconds: 30));
var encodedJwt = new EncodedJwt('');
var jwt = await decoder.convert(encodedJwt);
print(jwt.payload);
}
```## Verification
Library verifies following data:
- Whether issuer is Google Accounts server
- Whether user's email is verified
- Whether JWT not expires
- Whether audience is equal to Client ID
- Whether signature is valid (automatically downloads certificates from Google servers and keep them in memory until they expires).
## Get Google JWTYou can obtain a Google JWT (a.k.a. *idToken*) with [just_google_signin](https://github.com/deftomat/just_google_signin) library.