Ararat Harutyunyan
Ararat Harutyunyan

Reputation: 926

How to get access token for google webmasters api (Node.js)

i need access token for submitting sitemap. i use passport like so

passport.authenticate('googleApi', {scope: ['profile', 'https://www.googleapis.com/auth/webmasters']});

and get

{ code: '4/aEzOOw1j-1rNCXCVajylMVRasdo2Kasdreisasdradk.MijA9hPKsg8WYFZr95uasdUzab8UkwI' }

in request.query

but this token is invalid according to

https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=MY_TOKEN

thanks in advance.

Upvotes: 1

Views: 413

Answers (1)

Ameerkhan
Ameerkhan

Reputation: 26

The code you have got is authorization code. You have to get access token by exchanging this authorization code. Read about oauth 2.0 authentication

Upvotes: 1

Related Questions