یہ صفحہ ابھی اردو میں دستیاب نہیں ہے۔ اسے انگریزی میں دکھایا جا رہا ہے۔
Single Sign-On with Microsoft
Needs Balance HTTP tunnels
اس صفحے پر 6 سیکشنز
Let visitors sign in with a Microsoft Entra ID work or school account, or a personal Microsoft account, before they can open an HTTP tunnel. You register an application in Microsoft Entra, add it to Localtonet as a provider, then turn it on for the tunnel.
Before you start #
- An HTTP tunnel and Balance on your account. See the Single Sign-On overview.
- Access to the Microsoft Entra admin center with a role that may register applications. Microsoft names Application Developer as the minimum.
- A decision on who may sign in: only your organization, any organization, or personal accounts too. It determines two of the addresses you enter in Localtonet. See Account types and endpoints.
Steps #
-
Register an application in Microsoft Entra #
Microsoft's own guides are Register an app in Microsoft Entra ID, Add a redirect URI and Add app credentials. In short:
- In the Microsoft Entra admin center, go to Entra ID › App registrations and select New registration.
- Enter a Name. Visitors see it when they sign in.
- Under Supported account types, choose who can use the application, then select Register.
- On the Overview page, copy the Application (client) ID. For a single-tenant application, also copy the Directory (tenant) ID.
- Under Manage, open Authentication, select Add Redirect URI, choose the Web platform, enter the redirect URI below and select Configure.
- Open Certificates & secrets › Client secrets and select New client secret. Add a description, choose an expiration and select Add. Copy the secret Value right away: Microsoft never displays it again after you leave the page.
Redirect URI (platform: Web)http://auth.localtonet.com/auth/callbackA client secret expires. Microsoft limits its lifetime to 24 months. When it expires, sign-in stops working until you create a new secret and save it in the Localtonet provider.
-
Add the provider in Localtonet #
Open My Tunnels › HTTP and select SSO at the top of the page. In the SSO providers dialog, select Add provider.
Field Value Provider name Any name, for example Company Microsoft. You see it in the tunnel settings.Provider type Microsoft. Changing the type of a saved provider empties Client ID, so enter the client ID and the client secret again. Active On Client ID The Application (client) ID from Microsoft Entra. Client secret The secret Value, not the Secret ID. It is never displayed after saving. Open Endpoints & callback. These values are filled in automatically:
Field Filled-in value Change it? Authorization endpoint https://login.microsoftonline.com/common/oauth2/v2.0/authorizeReplace commonaccording to the table in the next section.Token endpoint https://login.microsoftonline.com/common/oauth2/v2.0/tokenReplace commonwith the same value as above.User info endpoint https://graph.microsoft.com/oidc/userinfoNo. It contains no tenant. Callback path /auth/callback/microsoftNo. Optionally fill in Email access rules, then select Save provider.
-
Turn it on for a tunnel #
Under Your tunnels, select Settings on the tunnel, then Manage next to SSO Providers. In the Single sign-on dialog, turn on Require sign-in and the switch of your Microsoft provider. Select Save.
The lists under Who can sign in and the Sign-in paths are optional. They are explained in the overview.
-
Test it #
Open the tunnel URL in a private browser window. Localtonet shows Sign in to continue with a button for your provider. After you sign in at Microsoft, you are sent back to the tunnel and your service loads.
Account types and endpoints #
The part of the Microsoft address after login.microsoftonline.com/ controls who can sign in. It must fit the Supported account types of your application. The Authorization endpoint and the Token endpoint always get the same value. The User info endpoint never changes.
| Supported account types in Microsoft Entra | Use instead of common | Who can sign in |
|---|---|---|
| Single tenant only | Your Directory (tenant) ID | Users and guests of your own tenant. |
| Multiple Entra ID tenants | organizations | Work or school accounts of any organization. |
| Any Entra ID Tenant + Personal Microsoft accounts | Keep common | Work or school accounts and personal Microsoft accounts. |
| Personal accounts only | consumers | Personal Microsoft accounts. |
Example for a single-tenant application. Replace <TENANT_ID> with your Directory (tenant) ID:
Authorization endpoint: https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize
Token endpoint: https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token
User info endpoint: https://graph.microsoft.com/oidc/userinfoA single-tenant application does not work with common. Microsoft answers with error AADSTS50194. Either put your tenant ID into both endpoints, or change the application to a multitenant account type.
With a multitenant or personal account type, people outside your organization can sign in at Microsoft. Use Allowed email domains on the provider, or Who can sign in on the tunnel, to admit only the people you want.
What Localtonet reads from Microsoft #
Microsoft's user info endpoint returns an email address only when one is associated with the account, so an account without an email address may not pass rules that work on email.
Troubleshooting #
AADSTS50011: the reply URL does not match
The redirect URI in the request is not registered for the application. The message shows the address that was sent. It must be identical to a redirect URI on the Authentication page of the app registration, on the Web platform, including upper and lower case. Register exactly http://auth.localtonet.com/auth/callback.
AADSTS50194: the application is not configured as a multitenant application
The application is single tenant, but the endpoints still contain common. Replace common with your Directory (tenant) ID in the Authorization endpoint and the Token endpoint, and select Save provider.
AADSTS700016: the application was not found in the directory
The Client ID is wrong, or the endpoints point to a tenant in which the application does not exist. Check the Application (client) ID and the tenant ID in the endpoints.
AADSTS7000215 or AADSTS7000222: invalid or expired client secret
Create a new client secret under Certificates & secrets, paste its Value into Client secret in Localtonet and select Save provider.
Microsoft asks for admin approval
Your tenant does not let users consent to applications themselves. An administrator of the tenant has to grant consent for the application in the Microsoft Entra admin center.
"403 - Access Denied" after a successful Microsoft sign-in
A Localtonet rule refused the account. Check Email access rules on the provider and Who can sign in on the tunnel, and whether the account has an email address at all. After you correct a rule, wait a minute and reload.