I have a two part question but I will break it up into two separate posts. Hopefully the first question will answer the second...The first ask is: I am working through the Google OAuth flow and would like if someone could confirm if my understanding of it is correct.
What I understand it to be is:
- We Authorize with this URL:
https://accounts.google.com/o/oauth2/auth?client_id=123456789&response_type=code&scope=https://www.googleapis.com/auth/theappweareusing&redirect_uri=/apex/testHTMLPage&access_type=offline
- This URL redirects us when we are done to
testHTMLPage
and includes acode
parameter with the authorization code. It looks something like this: https://nf--c.na99.visual.force.com/apex/testHTMLPage?code=7/aksdjfio900293842;kajs33222` - We take the
authorization code
from the page URL and use it to exchange for the authorization token and refresh token - Once I have both of these tokens, I call the
https://accounts.google.com/o/oauth2/token
and pass it the token, the key, the secret, and the redirect uri - I should get back a response status code of 200 and can move on from there
Does this sound correct? I am having difficulty breaking the authorization down around step 2 and want to make sure I am understanding correctly.
Thank you!