رفتن به محتوا
Localtonet Localtonet داشبورد

این صفحه هنوز به فارسی در دسترس نیست و به زبان انگلیسی نمایش داده می‌شود.

Single Sign-On with Google

Needs Balance HTTP tunnels

کمک درباره این صفحه
در این صفحه 4 بخش
  1. Before you start
  2. Steps
  3. Create an OAuth client in Google Cloud
  4. Add the provider in Localtonet
  5. Turn it on for a tunnel
  6. Test it
  7. Troubleshooting
  8. Related pages

Let visitors sign in with their Google account before they can open an HTTP tunnel. You create an OAuth client in Google Cloud, add it to Localtonet as a provider, then turn it on for the tunnel.

Before you start #

Steps #

  1. Create an OAuth client in Google Cloud #

    Google changes its console from time to time. Its own guide is Manage OAuth Clients. In short:

    1. In the Google Cloud console, open Google Auth Platform for your project. If the project is new, the console asks you to set up the app first: an app name, a support email, the audience and contact information.
    2. Under Audience, choose who may sign in. See the table below.
    3. Open Clients and select Create client.
    4. Set Application type to Web application and give the client a name.
    5. Under Authorized redirect URIs, add the redirect URI below. Authorized JavaScript origins can stay empty.
    6. Select Create, then copy the Client ID and the Client secret. Google shows the full secret only at this point.
    Authorized redirect URI
    http://auth.localtonet.com/auth/callback
    Audience in GoogleWho can sign in
    InternalOnly members of your Google Cloud organization.
    External, publishing status TestingThe test users you list in Google, up to 100. Google makes an exception for apps that request only the name, email address and profile of the user: for those, users do not need to be on the list. Do not rely on the test user list to keep people out; use Localtonet's access rules.
    External, publishing status In productionAnyone with a Google account. Use Localtonet's access rules to narrow it down.

    The sign-in requests the scopes openid, email and profile. If Google asks you to choose scopes for the app, these three are enough.

    Google says a change to a client can take from 5 minutes to a few hours to take effect.

  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 Google. You see it in the tunnel settings.
    Provider typeGoogle. Changing the type of a saved provider empties Client ID, so enter the client ID and the client secret again.
    ActiveOn
    Client IDThe client ID from Google.
    Client secretThe client secret from Google. It is never displayed after saving.

    Under Endpoints & callback the standard Google addresses are filled in automatically. Leave them as they are:

    FieldFilled-in value
    Authorization endpointhttps://accounts.google.com/o/oauth2/v2/auth
    Token endpointhttps://oauth2.googleapis.com/token
    User info endpointhttps://openidconnect.googleapis.com/v1/userinfo
    Callback path/auth/callback/google

    Optionally fill in Email access rules. To admit only your company, enter its domain, for example example.com, under Allowed email domains. 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 Google 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 Google, you are sent back to the tunnel and your service loads.

Troubleshooting #

Google reports redirect_uri_mismatch

The redirect URI in the request is not one of the Authorized redirect URIs of the client. Add exactly http://auth.localtonet.com/auth/callback to the client in Google and allow some time for the change to take effect.

The Google console does not accept the redirect URI

Google checks redirect URIs against its validation rules. The message next to the field names the rule that failed.

Google refuses the account, for example with org_internal

Google refused the account before Localtonet saw it. With the audience Internal, only members of your organization can sign in, and Google reports org_internal for everyone else. With External in Testing, check the test user list in Google.

Google reports invalid_client

Google does not accept the client. Check the Client ID and the Client secret saved in Localtonet, and that the client still exists in Google. Paste both again and select Save provider. If you no longer have the secret, create a new one in Google.

"403 - Access Denied" after a successful Google sign-in

A Localtonet rule refused the account. Compare the address the visitor signed in with against Allowed email domains, Blocked email domains and Blocked email addresses of the provider, and against Who can sign in on the tunnel.

There is no Google button on the sign-in page

The provider is not turned on for this tunnel, or it is set to inactive. Check both.

پشتیبانی