Skip to content
Localtonet Localtonet Dashboard

Single Sign-On for HTTP tunnels

Needs Balance HTTP tunnels

On this page 10 sections
  1. When to use it
  2. How it works
  3. Before you start
  4. Providers
  5. Set it up
  6. Add a provider
  7. Turn it on for a tunnel
  8. Test it
  9. The redirect URI
  10. Access rules
  11. Sign-in paths and sign-out path
  12. Troubleshooting
  13. Automation

Single sign-on (SSO) puts a sign-in page in front of an HTTP tunnel. Visitors sign in with an identity provider you choose, such as Google, GitHub, Microsoft or GitLab, or with a username and password you define, before any request reaches your service.

When to use it #

Until you protect it, an HTTP tunnel is open to anyone who has its address. SSO is the right protection when people open the tunnel in a browser and you want to decide who they are: an admin panel, a dashboard, an internal tool, a staging site. Your service does not change and never sees a password.

SSO is made for browsers. A request that does not carry the sign-in cookie is redirected to the sign-in page, so scripts, webhooks and API clients cannot pass. For those, protect only some paths (see Sign-in paths) or use the options in Access control.

How it works #

A visitor opens the tunnel URL. The Localtonet server redirects the visitor to the sign-in page on auth.localtonet.com, where the visitor signs in with an identity provider. The visitor is then sent back to the tunnel URL and the request is forwarded to your service. Visitor Browser 1. Opens Tunnel URL Localtonet server 2. Redirect Sign-in page auth.localtonet.com 3. Sign in Provider Google, GitHub… 4. Signed in, back to the tunnel 5. Request Your service On your device
The sign-in happens on Localtonet's sign-in page, not in your service.
  1. A visitor opens the tunnel URL. A request over HTTP is redirected to HTTPS first.
  2. The visitor is not signed in yet, so the Localtonet server redirects the browser to the sign-in page on auth.localtonet.com. The page has the heading Sign in to continue and offers the providers you turned on for this tunnel.
  3. The visitor chooses a provider and signs in there. For a username and password provider, the form is on the sign-in page itself.
  4. Localtonet checks your access rules and sends the visitor back to the address they asked for. The sign-in is kept in a cookie for the tunnel's host name. It is a browser-session cookie, sent over HTTPS only.
  5. From then on, requests are forwarded to your service as usual. When the sign-in is no longer valid, the visitor is sent to the sign-in page again.

A visitor who signs in but is not allowed by your rules sees 403 - Access Denied with the text "You do not have permission to access this tunnel."

Paths under /.well-known are never put behind the sign-in.

Before you start #

  • An HTTP tunnel. See HTTP / HTTPS.
  • Balance on your account. Without it, saving a provider or turning on sign-in fails with "You need to purchase balance to use this feature." See Plans and Balance and Pricing.
  • For an external provider: an account there that lets you register an OAuth application.

SSO is set up in your personal dashboard. The SSO button and the SSO Providers setting are not shown for team tunnels.

Providers #

These guides cover the most common choices step by step:

The Provider type list in the dashboard contains: Username-Password, Google, GitHub, Microsoft, OpenID Connect, Discord, Twitter (X), Custom, Facebook, Apple, LinkedIn, GitLab, Slack, Spotify, Twitch, Reddit, Bitbucket, Amazon and Yahoo. For every type except Username-Password and Custom, the endpoints are filled in for you. For OpenID Connect the filled-in addresses are examples that you replace with your provider's endpoints.

Set it up #

There are two parts. You add a provider once, and it is then available to all your HTTP tunnels. After that you turn it on for each tunnel you want to protect. A saved provider protects nothing until a tunnel uses it.

  1. Add a provider #

    Open My Tunnels › HTTP and select SSO at the top of the page (its tooltip reads SSO Provider Settings). The SSO providers dialog opens. Select Add provider, fill in the form and select Save provider. Each provider is saved separately.

    FieldWhat it isNotes
    Provider nameA name to identify this provider in your tunnel settings.Required. For example Company Google.
    Provider typeThe sign-in method.A new provider starts as Google. Changing the type of a saved provider empties Client ID, so enter the client ID and the client secret again.
    ActiveMakes the provider available to tunnels.When you switch a provider to inactive and save, it is also turned off on every tunnel that used it.
    Client IDThe ID of the application you registered at the provider.Required for every type except Username-Password and Custom.
    Client secretThe secret of that application.Never displayed after saving. Leave it blank later to keep the saved secret.
    Endpoints & callbackAuthorization endpoint, Token endpoint, User info endpoint and Callback path.Filled in automatically for the standard providers. Change them only when a guide tells you to.
    Email access rulesAllowed email domains, Blocked email domains and Blocked email addresses.Optional. See Access rules.
    Sign-in usersUsernames and passwords.Only for the types Username-Password and Custom.

    To remove a provider, select Delete provider. This removes it from your account and from the SSO settings of your tunnels.

  2. Turn it on for a tunnel #

    Under Your tunnels, select Settings on the tunnel. In the Tunnel settings panel, find SSO Providers and select Manage. The Single sign-on dialog opens.

    SettingWhat it does
    Require sign-inTurns SSO on for this tunnel. Visitors who aren't signed in are sent to the sign-in page first.
    ProvidersOne switch for each of your active providers. Turn on at least one. If several are on, the visitor chooses on the sign-in page.
    Who can sign inOptional lists of Email addresses, Email domains and Usernames for this tunnel.
    Sign-in and sign-out pathsOptional Sign-in paths and a Sign-out path.

    Select Save.

  3. Test it #

    Open the tunnel URL in a private browser window. You should arrive on the Sign in to continue page, and after signing in, on your service.

The redirect URI #

An external provider asks where it may send people after they sign in. For every tunnel this is an address on Localtonet's sign-in host, not the address of your tunnel. Register exactly this value:

Redirect URI
http://auth.localtonet.com/auth/callback

Each provider guide tells you where to enter it.

ValueWhere it goes
The redirect URI aboveAt the provider: Authorized redirect URIs (Google), Authorization callback URL (GitHub), Redirect URI (Microsoft, GitLab).
Callback path, for example /auth/callback/googleIn Localtonet, under Endpoints & callback. It is filled in for you. Leave it as it is.

The provider compares the redirect URI with the registered value exactly, so copy it as it is shown here.

Access rules #

Signing in proves who a visitor is. The rules decide whether that person may open the tunnel. There are two levels, and both apply.

WhereListWhat the dashboard says
ProviderAllowed email domainsLeave blank for no domain restriction. Wildcards depend on the provider.
ProviderBlocked email domainsBlock sign-ins from these email domains.
ProviderBlocked email addressesBlock these individual email addresses.
TunnelEmail addresses, Email domains, UsernamesLeave a list empty to skip that check. The lists apply to all providers turned on for the tunnel.

Enter one item per line, or separate items with commas. A domain is entered without @, for example example.com.

After you change a rule, a visitor who was already let in can keep access for up to five minutes. A visitor who was refused is checked again after one minute.

Sign-in paths and sign-out path #

SettingBehaviourExample
Sign-in pathsEmpty: every path of the tunnel needs sign-in. Filled: only requests whose path starts with one of the entries need sign-in./admin covers /admin and /admin/users, not /administrator.
Sign-out pathOpening it removes the sign-in for this tunnel and sends the visitor to the start page of the tunnel, or to the address in a returnUrl query value./sso/logout

Paths start with a slash. Upper and lower case make no difference.

A filled Sign-in paths list opens everything else. With /admin in the list, only /admin is protected and all other paths are reachable without sign-in. Leave the list empty to protect the whole tunnel.

The sign-out path signs the visitor out of the tunnel only. It does not sign them out of Google, GitHub or another identity provider.

Troubleshooting #

"You need to purchase balance to use this feature."

SSO needs Balance. Add Balance, then save again. Without Balance you can still open the dialog and turn Require sign-in off.

"Add a provider before you turn on sign-in."

You have no active provider yet. Select Add a provider in the dialog, or use the SSO button at the top of the HTTP page.

"Turn on at least one provider, or turn off sign-in."

Require sign-in is on but no provider switch is on. A provider that you set to inactive is turned off on its tunnels and no longer listed.

The sign-in page says "No authentication providers are currently configured for this tunnel."

Sign-in is required, but no provider is turned on for this tunnel. Open SSO Providers › Manage on the tunnel and turn one on.

The tunnel opens without asking for sign-in

Check that Require sign-in is on and saved. If Sign-in paths is filled, only those paths are protected. Also test in a private window: your own browser may still be signed in.

"403 - Access Denied" after signing in

The sign-in worked, but a rule refused the account. Check the provider's Email access rules and the tunnel's Who can sign in lists. After you correct a rule, wait a minute and reload.

A webhook or API client gets a redirect instead of an answer

Requests without the sign-in cookie are redirected to the sign-in page. Put only the pages meant for people in Sign-in paths, or use a separate tunnel for machine traffic.

Automation #

Providers and tunnel SSO settings can also be managed through the API, under /api/v2/sso-providers, and through the MCP server.

Support