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 · 7 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!

@cstevenson93
Copy link

What hash were you using? I'm having issues getting Microsoft Authenticator work with 256 and 512, but google authenticator and apple passwords work fine. Microsoft Authenticator seems to generate the same code as duo, which also doesn't work. But if I go to SHA1, then all four work.

@ramonsmits
Copy link

Are your using Base32 decode?

@cstevenson93
Copy link

Are your using Base32 decode?

I am. It seems that even though I'm passing along SHA256/SHA512 in the algorithm parameter, Microsoft and Duo are only giving back an SHA1 code. I verified them against both 512 and 1 and Google/Apple passed the 512 check and Microsoft/Duo passed the 1 check Are they not compatible with higher hashes? I'm struggling to find up to date info for Microsoft Authenticator compatibility.

@ramonsmits
Copy link

I am. It seems that even though I'm passing along SHA256/SHA512 in the algorithm parameter, Microsoft and Duo are only giving back an SHA1 code.

What are you trying to say here? QR codes are generated by the service/application. You're getting a token.

Why are you bringing up Microsoft Authenticator? That has nothing to do with?

What are you trying to accomplish?

  1. Generate a TOTP from a hash provided by a Microsoft loging
  2. Generate a hash/QR code to store in Microsoft Authenticator?

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

4 participants