j_shoon24
j_shoon24

Reputation: 39

How to get Google oauth client access token?

I want to know the API to get the Google OAuth client access token.

I want to use only client_id, client_secret, user_name, and user_password when I bring an access token. (Because the method using redirect uri is not applicable)

for example

https://{get-google-OAuth-client-access-toke-api}

body: {
    client_id: xxx
    client_secret: xxx
    user_name: xxx
    user_password: xxx
}

so.. Is it possible to wonder if it could be imported into grant-type = password? https://developer.okta.com/blog/2018/06/29/what-is-the-oauth2-password-grant

Help me...

Upvotes: 1

Views: 546

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117281

What you are referring to is called client login. It was a method of getting a access token using a login and password.

Google shut down client login in 2015.

In our efforts to eliminate password-only authentication, we took the first step by announcing a deprecation date of April 20, 2015 for ClientLogin three years ago. At the same time, we recommended OAuth 2.0 as the standard authentication mechanism for our APIs. Applications using OAuth 2.0 never ask users for passwords, and users have tighter control over which data client applications can access. You can use OAuth 2.0 to build clients and websites that securely access account data and work with our advanced security features like 2-step verification.

You will need to use Oauth2 now. Have your user run your application and consent to your accessing their data once they have done that you will get an access token.

Gant type password is not allowed with the Google Authorization server.

Because the method using redirect uri is not applicable

Redirect uri is only needed for web applications if you have an installed application or a mobile app you should not need it.

Upvotes: 1

Related Questions