Skip to content

Recording company name with authenticator app #152

Closed

Description

@jamminjames

In your demo, you have:

// substitute your company or app name here
$tfa = new RobThree\Auth\TwoFactorAuth(new RobThree\Auth\Providers\Qr\QRServerProvider());

But it's not clear where to put the company name. I tried:
$tfa = new RobThree\Auth\TwoFactorAuth(new RobThree\Auth\Providers\Qr\QRServerProvider('Company Name'));

... but after scanning the QR code, the Google Authenticator app I'm using does not show the company name. It only shows the user email from:
$tfa->getQRCodeImageAsDataUri($username, $secret);

How do we enter the company name for the authenticator app?

Thanks for any help.

Activity

  1. NicolasCARPi commented on Dec 1, 2025

    @NicolasCARPi
    SponsorCollaborator

    Hello,

    That comment is misleading, we'll correct that.

    The constructor takes an issuer nullable string as second argument:

    private readonly ?string $issuer = null,

    So it would be:

    $tfa = new TwoFactorAuth(new QRServerProvider(), "Acme Corp");
  2. willpower232 commented on Dec 1, 2025

    @willpower232
    Collaborator

    ah yeah accidental removal of the company name in #130

  3. jamminjames commented on Dec 1, 2025

    @jamminjames
    Author

    Thanks! Another thing that was unclear from the documentation was that you don't really need to pick a QR code creator (like BaconQrCodeProvider, etc). I only figured out from the demo that we could just do:

    $tfa = new RobThree\Auth\TwoFactorAuth(
        new RobThree\Auth\Providers\Qr\QRServerProvider());
    

    ... and now with the company name, as you clarified:

    $tfa = new RobThree\Auth\TwoFactorAuth(
        new RobThree\Auth\Providers\Qr\QRServerProvider(),
    	"Acme");
    
  4. NicolasCARPi commented on Dec 1, 2025

    @NicolasCARPi
    SponsorCollaborator

    @jamminjames Feel free to submit a PR with the changes would have liked to have seen in the doc ;)

  5. jamminjames commented on Dec 2, 2025

    @jamminjames
    Author

    Never submitted a PR before, looked at it and didn't know what to use for "Compare changes," but in Getting Started, under "Create an instance," you could list the example you used in the demo, which I ended up using (with the company name option added),

    $tfa = new RobThree\Auth\TwoFactorAuth(
        new RobThree\Auth\Providers\Qr\QRServerProvider(),
    	"Acme");
    

    ...as it is the simplest/easiest way to go, as far as I can see.

  6. NicolasCARPi commented on Dec 2, 2025

    @NicolasCARPi
    SponsorCollaborator

    Something like: #154 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions