As of now, Microsoft enables importing hardware TOTP (Time‑Based One‑Time Password) tokens that use the HMAC‑SHA256 algorithm.
In this blog post, we aim to answer the following questions:
- Are my TOTP tokens that use only HMAC-SHA1 insecure?
- Can I continue using my existing HMAC‑SHA1 tokens?
- Is it possible to run HMAC‑SHA1 and HMAC‑SHA256 in parallel?
- What are the differences when importing HMAC‑SHA1 vs. HMAC‑SHA256 tokens?
- How does the import process for HMAC‑SHA256 tokens work?
Are my TOTP tokens that use only HMAC-SHA1 insecure?
Short answer: No.
Here’s a quick technical overview of how OTPs work:
OTPs are generated using an HMAC mechanism (e.g. HMAC‑SHA1, HMAC‑SHA256, HMAC‑SHA512), combining:
- A moving factor (such as the current time),
- A shared secret key known by both the client (token) and the server (Microsoft Entra).
OTPs are generated using an HMAC mechanism (e.g. HMAC‑SHA1, HMAC‑SHA256, HMAC‑SHA512), combining: A moving factor (such as the current time), A shared secret key known by both the client (token) and the server (Microsoft Entra).
Thus, the security of an OTP depends less on the hash algorithm, and more on protecting the secret key and ensuring a robust implementation.
Common OTP weaknesses stem from:
- Compromise or theft of the secret key (e.g. unauthorized OTP generation),
- Brute‑forcing OTPs,
- Phishing attacks.
Bottom line: OTP vulnerabilities are tied to key handling, storage, and implementation—not the use of SHA‑1 vs. SHA‑256.
Quellen:
RFC 4226 – HOTP: An HMAC-Based One-Time Password Algorithm – Appendix B
RFC 6238 – TOTP: Time-Based One-Time Password Algorithm
Can I continue using my existing HMAC‑SHA1 tokens?
Yes, you can continue to use them without issue.
Can HMAC‑SHA1 and HMAC‑SHA256 operate in parallel?
Yes, Entra supports using both types simultaneously in the same environment.
What are the differences when importing HMAC‑SHA1 vs. HMAC‑SHA256 tokens?
HMAC‑SHA1 TOTP tokens can be imported via a seed file in CSV format—either through the Entra web portal or using the Microsoft Graph API (JSON format).
HMAC‑SHA256 TOTP tokens can only be imported via the Microsoft Graph API—CSV import via the portal is not supported.
How to import HMAC‑SHA256 tokens
Was wird benötigt:
- Eine Seed-Datei im JSON-Format (z. B. „SNstart-SNend_azure_base32secret.json“), die wir bereitstellen (verfügbar ab 15.07.2025)
- TOTP-Token, die den HMAC-SHA256-Algorithmus verwenden
- Zugriff auf das Microsoft Entra Admin-Portal und die Microsoft Graph API
Schritt-für-Schritt-Anleitung
1. Prüfen, ob Hardware-OATH-Token in Entra aktiviert sind
- ·Melden Sie sich an Ihr Entra Portal an https://entra.microsoft.com/
- Navigieren Sie wie folgt zu den Authentifizierungsmethoden:
- Menü → Identität → Schutz → Authentifizierungsmethoden

2. Importieren der Token
- Melden Sie sich an: https://developer.microsoft.com/en-us/graph/graph-explorer
- Stellen Sie sicher, dass Ihr Tenant gewählt ist auf dem Sie den Import ausführen wollen
- Aktivieren Sie die Berechtigung Policy.ReadWrite.AuthenticationMethod
- Wählen Sie als HTTPS-Request-Methode: POST
- Wählen Sie als Microsoft API-Version: beta
- Tragen Sie folgende URL ein: https://graph.microsoft.com/beta/directory/authenticationMethodDevices/hardwareOathDevices
- Klicken Sie auf „Modify Permissions“ und anschließend auf „Open the permission panel“
- Suchen Sie im „Permission panel“ nach Policy.ReadWrite.AuthenticationMethod und stimmen Sie dieser zu
- Schließen Sie das „Permission panel“
- Wechseln Sie in den Reiter „Request body“
- Fügen Sie den Inhalt der JSON-Seed-Datei ein
- Starten Sie den Import
3. Nach erfolgreichem Import
Wenn die Token erfolgreich importiert wurden, erhalten Sie folgende Ausgabe:
Hinweis: Der Benutzer kann den Token anschließend selbst registrieren.
Noch Fragen?
Sollten Sie Fragen haben oder Unterstützung benötigen, kommen Sie gern auf uns zu und lassen Sie sich beraten.