MyBB Community Forums

Full Version: Improve 2FA QRCode presentation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I saw after some test that the 2FA of the admin page is not containing any issuer, and so in my 2FA application FreeOTP it shows:

[Image: unnamed.png]

Instead of "Fedora", Unknown issuer
Instead of "[email protected]", <your_username>@<the_name_of_your_mybb>

For that, you just need to change in L.146:
https://github.com/mybb/mybb/blob/c3dcfa...s.php#L146

$qr = $auth->getQRCodeGoogleUrl($mybb->user['username']."@AdminCP", $admin_options['authsecret'], str_replace(" ", "", $mybb->settings['bbname']));

I don't know the consequence of this change on the 2FA feature, it's why I didn't create a PR

With this change you'll have
Instead of "Fedora", <the_name_of_your_mybb>
Instead of "[email protected]", <your_username>@AdminCP

Cheers
I think your suggestion is sound, but I was unable to confirm this on my Apps, probably because I entered the name myself but just can't remember.

Lets see what others have to say to consider pushing a Github issue for it.

Additionally, I think it probably would be better suited for 1.9 to avoid assigning work on 1.8
Maybe it's related to FreeOTP, https://github.com/freeotp/freeotp-andro...#L245-L246

And there is no issuer in the case of mybb admin 2FA
Hello @Eldenroot

Thanks for taking care of the PR

Sama34 is true here: https://github.com/mybb/mybb/pull/4774#i...1867007235

Maybe the best way it to indicate the admin URL, something like that? (to be tested):

$adminurl = $mybb->settings['bburl'] . '/' . $config['admindir']
$qr = $auth->getQRCodeGoogleUrl($mybb->user['username'], $admin_options['authsecret'], $adminurl);

With this change you'll have
Instead of "Fedora", <the_url_of_the_admin_cp_of_you_mybb>
Instead of "[email protected]", <your_username>

(2023-10-25, 03:21 AM)OmarĀ G. Wrote: [ -> ]I think your suggestion is sound, but I was unable to confirm this on my Apps, probably because I entered the name myself but just can't remember.Lets see what others have to say to consider pushing a Github issue for it.Additionally, I think it probably would be better suited for 1.9 to avoid assigning work on 1.8

Oh it's sad to not remember Sad