Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open Google Authenticator from a link?

I'm developing a website that requires a 2FA. We already permit to users to set it by scanning a QR Code shown in our configuration page.

My question is a bit more tricky. How can I permit user to open the app if he opens the page from mobile browser, ie. navigating from the phone with the Authenticator app installed?

I already have the logic to understand if the user is on mobile or not, but I don't find any solution that can replace the QRCode since the user cannot use the mobile camera in that case (he is using the phone to net on my website!).

I was searching the possibility to create a link that is recognised by an authenticator app (Google Authenticator or Microsoft Authenticator) but I didn't find a solution. Any idea?

like image 389
alessandro308 Avatar asked Oct 15 '25 14:10

alessandro308


1 Answers

After some research and trial, I found the link I was searching for. In Google Authenticator (or any other app), the account are listed in the form:

  • Amazon([email protected])
    • 123455
  • Google([email protected])
    • 455234
  • Issuer(email)
    • 554645
  • AnotherCode
    • 142414

In order to generate a new entry without scanning the QRCode, a link in the form of:

otpauth://totp/[email protected]?secret=123abc&issuer=StackOverflow

has to be opened. For instance, the link above results in the following entry:

  • StackOverflow([email protected])

The link is opened by the phone using the installed Authenticator app.

like image 101
alessandro308 Avatar answered Oct 18 '25 04:10

alessandro308



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!