C
C
cyberorg2012-12-04 12:10:51
Google
cyberorg, 2012-12-04 12:10:51

Google OAuth: how to get access_token correctly?

Good afternoon!

This morning I ran into the problem of getting a token from Google.

At the moment, the situation is this: frontend goes to Google and gets code. It sends this code to the backend (a Java application with Embedded Jetty on board).
Having received this code, the backend makes a request to Google and, having received the token, stores it with itself and requests Google for account data. - Here is the plug.
According to the documentation, to get a token, you need to send a POST request with a code. In addition to the code in the request, there is a redirect_to parameter.

Two points are not clear to me here:
1) If you specify the same application in redirect_to, will the response from Google come as a response to a POST Request or in the form of a new connection?
2) Is it possible to omit this parameter?
3) The documentation says that the response will be in the form of JSON, will it come by POST or GET?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2012-12-04
@kyberorg

1) the answer will be directly in the body, sorry for the tautology, the answer is
2) no
3) it will be in the body of the answer. there will be no requests from Google to you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question