Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alopes/google-oauth2-token-info

oauth2 v3 token info
https://github.com/alopes/google-oauth2-token-info

google-api npm-package oauth2 token-authetication

Last synced: 18 days ago
JSON representation

oauth2 v3 token info

Awesome Lists containing this project

README

        

# google-oauth2-token-info

## Installation

The library is distributed on `npm`. In order to add it as a dependency,
run the following command:

~~~~ sh
$ npm install google-oauth2-token-info --save
~~~~

## Usage

~~~~ js
var tokenInfo = require('google-oauth2-token-info');

const token = '123abc...' // example token

tokenInfo(token)
.then(data => {
console.log(data);
});
~~~~

#### Response for a valid token
~~~~ js
{
azp: "xxxxxxxxxxx",
aud: "xxxxxxxxxxx",
sub: "xxxxxxxxxxx",
hd: "xxxxxxxxxxx",
email: "xxxxxxxxxxx","xxxxxxxxxxx",
email_verified: "xxxxxxxxxxx",
at_hash: "xxxxxxxxxxx",
iss: "xxxxxxxxxxx",
iat: "xxxxxxxxxxx",
exp: "xxxxxxxxxxx",
name: "xxxxxxxxxxx",
picture: "xxxxxxxxxxx",
given_name: "xxxxxxxxxxx",
family_name: "xxxxxxxxxxx",
locale: "xxxxxxxxxxx",
alg: "xxxxxxxxxxx",
kid: "xxxxxxxxxxx"
}
~~~~