Tsallake zuwa abun ciki
Localtonet Localtonet Dashboard

Wannan shafin bai samu a cikin Hausa tukuna ba. Ana nuna shi da Turanci.

Single Sign-On with Microsoft

Needs Balance HTTP tunnels

Taimako kan wannan shafi
A wannan shafin 6 sassa
  1. Before you start
  2. Steps
  3. Register an application in Microsoft Entra
  4. Add the provider in Localtonet
  5. Turn it on for a tunnel
  6. Test it
  7. Account types and endpoints
  8. What Localtonet reads from Microsoft
  9. Troubleshooting
  10. Related pages

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 #

  1. 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:

    1. In the Microsoft Entra admin center, go to Entra ID › App registrations and select New registration.
    2. Enter a Name. Visitors see it when they sign in.
    3. Under Supported account types, choose who can use the application, then select Register.
    4. On the Overview page, copy the Application (client) ID. For a single-tenant application, also copy the Directory (tenant) ID.
    5. Under Manage, open Authentication, select Add Redirect URI, choose the Web platform, enter the redirect URI below and select Configure.
    6. 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/callback

    A 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.

  2. 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.

    FieldValue
    Provider nameAny name, for example Company Microsoft. You see it in the tunnel settings.
    Provider typeMicrosoft. Changing the type of a saved provider empties Client ID, so enter the client ID and the client secret again.
    ActiveOn
    Client IDThe Application (client) ID from Microsoft Entra.
    Client secretThe secret Value, not the Secret ID. It is never displayed after saving.

    Open Endpoints & callback. These values are filled in automatically:

    FieldFilled-in valueChange it?
    Authorization endpointhttps://login.microsoftonline.com/common/oauth2/v2.0/authorizeReplace common according to the table in the next section.
    Token endpointhttps://login.microsoftonline.com/common/oauth2/v2.0/tokenReplace common with the same value as above.
    User info endpointhttps://graph.microsoft.com/oidc/userinfoNo. It contains no tenant.
    Callback path/auth/callback/microsoftNo.

    Optionally fill in Email access rules, then select Save provider.

  3. 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.

  4. 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 EntraUse instead of commonWho can sign in
Single tenant onlyYour Directory (tenant) IDUsers and guests of your own tenant.
Multiple Entra ID tenantsorganizationsWork or school accounts of any organization.
Any Entra ID Tenant + Personal Microsoft accountsKeep commonWork or school accounts and personal Microsoft accounts.
Personal accounts onlyconsumersPersonal Microsoft accounts.

Example for a single-tenant application. Replace <TENANT_ID> with your Directory (tenant) ID:

Single tenant
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/userinfo

A 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.

Taimako