Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Microsoft Authenticator has different URI for issuer. #1

Open
JaderCM opened this issue Jun 1, 2020 · 2 comments
Open

Microsoft Authenticator has different URI for issuer. #1

JaderCM opened this issue Jun 1, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@JaderCM
Copy link

JaderCM commented Jun 1, 2020

I tried to use your library to add on Microsoft MFA app and the issuer shows wrong.

I checked the URI of otpauth protocol and the parameters are different for Microsoft MFA app.

If the class Auth generate the URI in this format, works (without encode $label):

urlencode("otpauth://{$parameters['type']}/{$parameters['issuer']}:$label?{$query_string}")
@arnissolle arnissolle self-assigned this Jun 2, 2020
@arnissolle arnissolle added the bug Something isn't working label Jun 2, 2020
@arnissolle
Copy link
Owner

Thanks for your feedback, I'll check that ASAP!
Feel free to make a pull-request 🙂

@JaderCM
Copy link
Author

JaderCM commented Jun 2, 2020

Usage

use Arnissolle\MFA\OTP\Auth;
use Arnissolle\MFA\OTP\Code;
use Arnissolle\MFA\OTP\Secret;
use Arnissolle\MFA\OTP as otp;

// Create new secret
$secret = Secret::create();

// Get the OTP auth URI
$authUri = Auth::uri($secret, '[email protected]', function(Auth $auth) {
    $auth->issuer = 'Company Name';
    $auth->app = otp\MICROSOFTAPP;
});

// Get the QR Code
// Then scan it with app like Google Authenticator
$qrCodeUrl = Auth::qrCodeUrl($authUri);

// Get code (or use third party app)
$code = Code::get($secret);

// Verify code (bool)
$verify = Code::verify($secret, $code);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants