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

https://github.com/debianmaster/social-auth

Module to validate access_token, get access_token from refresh_token, store them in db etc
https://github.com/debianmaster/social-auth

Last synced: 11 months ago
JSON representation

Module to validate access_token, get access_token from refresh_token, store them in db etc

Awesome Lists containing this project

README

          

### Initialize
```javascript
var Google = require('social-auth').google;
var client_id="2514_FAKE_52.apps.googleusercontent.com";
var client_secret="dpt_FAKE_4RwU8O";
var callback="http://localhost/callback";
var social=new Google(client_id,client_secret,callback);
```

### Get refresh token from CODE
```javascript
var code="1/co0mLVRWaGDxy_FAKE_JDtdun6zK6XiATCKT";
social.getRefreshTokenFromCode(code,function(err,data){
console.log(err,data);
})
```

### Get ACCESS_TOKEN from REFRESH_TOKEN
```javascript
var refresh_token="1/co0mLVRWaGDxyXMQ_FAKE_rJDtdun6zK6XiATCKT";
social.getAccessTokenFromRefreshToken(refresh_token,function(err,data){
console.log(err,data);
})
```

### Validate ACCESS_TOKEN
```javascript
var access_token = "ya29._FAKE_-nev6swAPDIWOpZDewUDYGRGwA_JMqDGVrFdfpnOuackTUPg";
social.isValidToken(access_token,function(err,data){
console.log(err,data);
});
```