Wala pa ang page na ito sa Filipino. Ipinapakita ito sa Ingles.
Single Sign-On with Google
Needs Balance HTTP tunnels
Sa page na ito 4 seksyon
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 #
- An HTTP tunnel and Balance on your account. See the Single Sign-On overview.
- A Google account with access to the Google Cloud console and a project in it.
Steps #
-
Create an OAuth client in Google Cloud #
Google changes its console from time to time. Its own guide is Manage OAuth Clients. In short:
- 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.
- Under Audience, choose who may sign in. See the table below.
- Open Clients and select Create client.
- Set Application type to Web application and give the client a name.
- Under Authorized redirect URIs, add the redirect URI below. Authorized JavaScript origins can stay empty.
- Select Create, then copy the Client ID and the Client secret. Google shows the full secret only at this point.
Authorized redirect URIhttp://auth.localtonet.com/auth/callbackAudience in Google Who can sign in Internal Only members of your Google Cloud organization. External, publishing status Testing The 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 production Anyone with a Google account. Use Localtonet's access rules to narrow it down. The sign-in requests the scopes
openid,emailandprofile. 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.
-
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 Google. You see it in the tunnel settings.Provider type Google. 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 client ID from Google. Client secret The 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:
Field Filled-in value Authorization endpoint https://accounts.google.com/o/oauth2/v2/authToken endpoint https://oauth2.googleapis.com/tokenUser info endpoint https://openidconnect.googleapis.com/v1/userinfoCallback path /auth/callback/googleOptionally fill in Email access rules. To admit only your company, enter its domain, for example
example.com, under Allowed email domains. 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 Google 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 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.