A cloud-based identity and access management service for securing user authentication and resource access
Hey @Rafael Sales,
I hear you needing tenant-scoped subdomains on localhost for your local OAuth flow is a very common modern-dev scenario, and the portal blocking http://subdomain.localhost… can be frustrating. As odd as it feels, the “Must start with HTTPS or http://localhost” error you’re seeing is actually an intentional, by-design restriction in the Azure portal’s current URI validation logic. Here’s the scoop:
- Why only “http://localhost” is allowed for HTTP
- Per the official docs (Redirect URI/supported schemes), HTTP schemes are supported only for the literal
localhostdomain. Although browsers and RFC 6761 treat any*.localhostas loopback, Azure’s portal validation hasn’t yet been updated to accept wildcards or subdomains under.localhost. - You can register
http://localhost,http://localhost:3000/abc(paths and ports are okay), buthttp://sub.localhost(even on port 3000) will be rejected.
- Per the official docs (Redirect URI/supported schemes), HTTP schemes are supported only for the literal
- Workarounds today
- Switch to HTTPS locally. You can generate a self-signed cert for your
*.localhostsubdomain and trust it in your dev machine. Then registerhttps://subdomain.localhost:3000/...in the portal. - Use the loopback IP
127.0.0.1in the manifest. You can addhttp://127.0.0.1:3000/…by editing the app’s manifest (replyUrlsWithType), but that only helps if you can route your subdomain traffic to 127.0.0.1 via hosts file or a local proxy. - Use a tunneling tool (ngrok, localtunnel) and register the secure HTTPS forwarding URL in the portal.
- Switch to HTTPS locally. You can generate a self-signed cert for your
- Why Microsoft hasn’t opened up wildcard-localhost yet
- Service-side validation is intentionally conservative for App Registrations to prevent unsafe redirects in production scenarios. Today the portal doesn’t distinguish sandbox vs. prod in that validation logic.
- Next steps / Ask the product team to reconsider
- You can file a feature request on Azure Feedback (https://feedback.azure.com) asking for support of
http://*.localhostas a safe loopback pattern. The linked standards (RFC 6761) and browser behavior all back this up, so the ask is reasonable.
- You can file a feature request on Azure Feedback (https://feedback.azure.com) asking for support of
Hope that helps explain what’s happening under the covers and gives you some options to unblock your local multi-tenant flow.