Steps:
- enable Google+ API in google console
- create credentials for
1
Web Application
- here’s the code snippet I used to obtain the code:
- I’m using
for node in this example, and I had the values for client_id, client_secret, and the redirect url mentioned there.1
dotenv
- at some point, the application will show the URL in the console, copy it and visit it in your browser
- google will redirect to your registered application URL with a
parameter. Write that down, paste it, and press enter. For this purpose, I had a rails app running in the background, with a1
code
so that I could inspect what’s sent as1
binding.pry
.1
params
- you will then see in the console the access_token, refresh_token and expiry_date. Those you can use when you make the API calls.