1

We are developing Native Mobile Application : Android platform, Ios Platform (Swift).

Instead of asking user to download and install https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_IN mobile app and then generate a QR code in our application to be scanned by this app, we are willing to do it api way. Means We want to call Google Authenticator API pass it QR image, secret and user is registered

Is this Ok and possible. Any one using it please suggest.

JemHah
  • 434
  • 4
  • 16

1 Answers1

0

I'm not going to say that this is impossible, but integrating Google Authenticator would be a nightmare, and likely wouldn't do what you're expecting it to do. Allow me to explain.

Problem #1

For each instance of the app, you'll have to have a Unique Identifier to pair it to Google's Authenticator. In other words, you'll need to generate a new QR code for each device, pass that off to the system (Which doesn't exist without the app.) to pair the application. This is going to require a "Log-In" to properly store.

Check out this for a possible work-around to Problem #1: https://authenticatorapi.com/

Problem #2

If you're already logging in and the device is already being authenticated, what purpose does the Google Authenticator provide? Well, I'm assuming it allows you to prevent unauthorized access, possibly prevent more than one device. There are infinitely easier ways to manage this, location services are the first one that comes to mind for me.

Possible Solution (iOS)

This is absolutely my go-to method for handling authentication. Encourage or require your users to use 2FA (Two Factor Authentication) attached to SMS messaging. A simple line of code such as this will grab an SMS one-time code.

// Available as of iOS 12, make sure to check version.
self.verifyCodeTextField.textContentType = .oneTimeCode

Android SMS Retrieval

Android Auto-SMS-Retrieval https://developers.google.com/identity/sms-retriever/overview

I don't know it all, most certainly, but I hope this opens the floor for some discussion and brings forth a solution or explanation to your question.

Research Material

Google Authenticator available as a public service?

java API for google Authenticator

xTwisteDx
  • 2,152
  • 1
  • 9
  • 25