How to force account login for a single account user with Google's OAuth 2.0?

前端 未结 1 1131
我在风中等你
我在风中等你 2021-01-13 07:44

Sometimes when a user logins into a site with Google\'s OAuth 2.0 they choose the wrong account to login with. Normally this isn\'t a problem if the user has more than one

相关标签:
1条回答
  • 2021-01-13 08:25

    Add the parameter prompt=select_account to your authorization request.

    This will cause the account chooser to always be shown, even if the user is only logged in to one account. Users will be able to select from their accounts, or add a new one.

    For example: https://accounts.google.com/o/oauth2/auth?redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&response_type=code&client_id=407408718192.apps.googleusercontent.com&scope=profile+email&access_type=offline&prompt=select_account

    0 讨论(0)
提交回复
热议问题