Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google OAuth2 API. Check user has two factor authentication (Not GSuite)

I use scopes:

  • https://www.googleapis.com/auth/userinfo.profile
  • https://www.googleapis.com/auth/userinfo.email

but result data of:

  • https://www.googleapis.com/oauth2/v1/userinfo
  • https://www.googleapis.com/oauth2/v3/tokeninfo

not contains info about exist two-factor auth on google account. Can I get boolean or another value about it?

like image 256
arturgspb Avatar asked Jul 25 '17 11:07

arturgspb


People also ask

How do I enable two factor authentication (2FA) in GSuite?

Two Factor authentication can be turned on through any user’s Google account settings, but its use can also be required by the Gsuite administrator through the Gsuite admin panel. Authenticate into your admin panel at admin.google.com. Choose the Security Icon.

How do I Turn on two-factor authentication for my Google account?

Turning on two-factor authentication for your google account should take two minutes or less to complete. While logged into your google account view your profile icon at top right. Click your icon and choose “Manage your google account” button in the dropdown. Select “Security” in the navigation bar.

What OAuth protocol does Google use for authentication?

Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports common OAuth 2.0 scenarios such as those for web server, client-side, installed, and limited-input device applications.

How does Google handle the user authentication?

Google handles the user authentication, session selection, and user consent. The result is an authorization code, which the application can exchange for an access token and a refresh token. The application should store the refresh token for future use and use the access token to access a Google API.


Video Answer


1 Answers

Sorry we don't expose If a user has 2 factor auth or not) through API. We have been thinking about this for a while.

We have been doing a lot of things to improve the security for all users (including the ones who have not enabled 2nd factor). This is based on the risk signals and we ask for second factor if the user has a phone # on their account even without a user enabling "strict" 2nd factor. This allows us to protect all users. The difference being in one case 2nd factor is required in all sign-in vs required when we think there is risk.

The problem is that if we do expose whether a user has enabled strict 2nd factor, a lot of 3rd parties will "force" users to become a "strict" 2 factor users without understanding what that means. So for now we don't have a timeline.

like image 83
nvnagr Avatar answered Sep 21 '22 14:09

nvnagr