I use scopes:
but result data of:
not contains info about exist two-factor auth on google account. Can I get boolean or another value about it?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With