Saravanan CM
Saravanan CM

Reputation: 39

How to select particular account while making oauth api call in google?

For Eg: Using google drive api i made an API call to get permission from user and generate access token and got user details using that token. In that case before getting permission from user if i logged in into multiple google accounts in my browser and i tried through particular mail Id through my app. I need to display only that mail id for permission , Not to display all the logged in mail ids. How to filter for particular mail id through api call.

My sample api call:

https://accounts.google.com/o/oauth2/auth?client_id=CLIENT_ID +&redirect_uri=REDIRECT_URI &scope=email+profile+https://www.googleapis.com/auth/drive&response_type=code&access_type=offline

I just removed prompt=select_account keyword from this api call. but it still display all accounts. How to filter for particular mail id?

Upvotes: 0

Views: 534

Answers (1)

Hans Z.
Hans Z.

Reputation: 54078

You add the login_hint parameter with an account value to the authentication request.

Upvotes: 4

Related Questions