Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /o/oauth2/token?grant_type=authorization_code&code=4%2F42sz3xxq4wGF9k9joYxRVop9mHi6.UpFaIUqZ_UQaaDn_6y0ZQNh869DgiwI&client_id=199079322117.apps.googleusercontent.com&client_secret=...&redirect_uri=...
- Yeah I know its a very old question but I faced the same problem today.
- and resolved the issue as follow.
- if you use form option it will automatically set content type
- appticationx-ww-orm-urtencoded
- var request = require('request');
- request.post('https://accounts.google.com/o/oauth2/token',
- {
- form: {
- code: '4/M9YCOpJkweTzLKbkoDSj1JiCtFGp.otpz-eXAviMZgrKXntQAax12uvgYjwI',
- client_secret: 'BpQ-5ck5rpD0ixFmGYsEP998',
- client_id: '256393709562-l4idip7eh234kulhcfo6i7shcqmvnd7v.apps.googleusercontent.com',
- grant_type: 'authorization_code',
- redirect_uri: 'https://developers.google.com/oauthplayground'
- }
- },function(err,res,body){
- console.log(body);
- if(err) console.log(err);
- //console.log(res);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement