Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with Microsoft https://mysignins.microsoft.com/security-info #62

Open
mhoang-woolworths-com-au opened this issue Jun 2, 2024 · 3 comments

Comments

@mhoang-woolworths-com-au

I have tried this on https://mysignins.microsoft.com/security-info choose Add new authentication method > Authenticator > not microsoft authenticator > grab the secret key, generate the 6 digits token to register but it never works tried for 30 mins (with fresh tokens)

@joaodev7
Copy link

It will depend on how you are creating the QRCode. I just tested it in my implementation and everything is fine. Can you share the QRCode creation code?

@ramonsmits
Copy link

I have the same issue. The QR code contains data in the following uri format:

otpauth://totp/{{ORG_NAME}}%3A{{USER_EMAIL}}?secret={{TOTP_SECRET_BASE64}}&issuer=Microsoft

I assume the secret is a base64 encoded byte array but I'm not sure but I do think that is the value that needs to be like:

var bytes = Convert.FromBase64String("XXXXXXXX");
var totp = new Totp(bytes);

I tried with different OtpHashMode but unfortunately none work.

@ramonsmits
Copy link

ok, my bad, seems the secret is not Base64 but Base32 encoded. Using Base32Encoding.ToBytes works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants