Docs›Run the office›Google sign-in

Google sign-in

People sign in to their own Gmail and Google Calendar in the Emergic app. Google needs a "Google app" (an OAuth client) for that sign-in. Your office can use Emergic's own Google app, which needs no setup, or your organization's own, which takes about ten minutes to make and removes Google's warning and limits.

The admin console shows which one is in use, under Mail and Calendar. Your organization's own app always wins: once you add it, every computer and phone switches to it at its next Google sign-in. Either way, mail and calendar go straight between each person's device and Google, never through the office server.

Which should you use?

  • Emergic's Google app for most offices. Nothing to set up; Google has verified it, so anyone can sign in.
  • Your organization's own Google app when your Google Workspace organization wants its own app in its own Google Cloud account. You need a Google Workspace admin account.

Option 1: Emergic's Google app

An office with no Google app of its own uses Emergic's. The console then says Emergic's Google app (works for any Google account). People choose Mail, then Sign in with Google, and that is all.

If your Workspace blocks the app: trust Emergic's Google app

Short version with both IDs: Let your Google Workspace staff use Emergic Mail.

By default, Google Workspace lets people sign in to outside apps. If your admin has turned that off, or has set Gmail to Restricted, people see an error from Google instead of the sign-in page. A Workspace admin can then allow Emergic's app without making an app of their own:

Open API controls#

Sign in to admin.google.com as an admin, then choose Security → Access and data control → API controls. You should see Settings and Manage Third-Party App Access.

Add Emergic's computer client#

Choose Manage Third-Party App Access → Configure new app → Search by OAuth client ID, paste the ID below, and press Search. Select the result.

690073347242-bvkc82s4jcddcu7v44oqdun2qol33vsl.apps.googleusercontent.com

Choose who and how much#

Keep the top organizational unit for everyone, or pick the units you want to try it with, then press Continue. Choose Trusted (this lets the app use restricted services such as Gmail), then Continue and Finish.

Add Emergic's iPhone client#

Repeat the two steps above with this ID, for people who use Emergic on an iPhone.

690073347242-0ncek3c7m56bkmgmfot69h2kuj4319tg.apps.googleusercontent.com

Both IDs then appear in the list with access Trusted. Changes can take up to 24 hours, and often take minutes. This opens the door in your Workspace only.

Option 2: use your organization's own Google app

You make a small Google app inside your own Google Cloud account, set it to Internal (only your organization's accounts can use it), and give its client file to Emergic. Google does not review an Internal app. Each step says what it does and what you should see.

You need: a Google Workspace admin account (a super admin, or an admin who can create Cloud projects), and the Emergic admin console. No Google Cloud experience is needed. The whole job takes about ten minutes. Using the Gmail and Google Calendar APIs this way is free.

Create a Google Cloud project#

A project is the folder that holds your Google app. Open Create a project, name it Emergic, and check that Organization shows your company name, not No organization. Press Create. You should see the project's name at the top of the page. Keep it selected for the next steps. If it says No organization, you are signed in with a personal Google account; sign in with your Workspace admin account instead, because only a project in an organization can be Internal.

Turn on the Gmail API#

This lets the project talk to Gmail. Open the Gmail API page and press Enable. You should see API enabled.

Turn on the Google Calendar API#

This lets it talk to Google Calendar. Open the Google Calendar API page and press Enable. You should see API enabled.

Set the name and the audience#

This is the sign-in page people see, and who may use it. Open Google Auth Platform and press Get started. Enter the app name Emergic and your support email, press Next, and choose the audience Internal. Enter a contact email, accept Google's terms, and press Create. Then open Audience in the left menu. It says the app is Internal, and only people in your organization can sign in. Your personal Gmail accounts cannot.

Add the four permissions Emergic uses#

These are the "scopes" people agree to when they sign in. Open Data access in the left menu and press Add or remove scopes. Under Manually add scopes, paste these four lines, press Add to table, then Update and Save:

https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/calendar.events
https://www.googleapis.com/auth/calendar.calendarlist.readonly
https://www.googleapis.com/auth/userinfo.email

They let Emergic read, label, archive, draft and send mail, change calendar events, list calendars, and learn which address signed in. Add exactly these four. Emergic asks for all four at sign-in, and sign-in fails if any is missing.

Create a Desktop app client and download its file#

The client is the app's identity, which Emergic signs in with. Open Clients in the left menu and press Create client (or open Create OAuth client). Choose the application type Desktop app, name it Emergic, and press Create. Google shows the Client ID and Client secret. Press Download JSON and keep the file private, because it holds the secret.

For iPhones, create an iOS client#

An iPhone signs in through its own client. Skip this step if nobody uses Emergic on an iPhone. On Clients, press Create client, choose iOS, name it Emergic iPhone, enter the bundle ID com.emergic.app, and press Create. Copy the Client ID. An iOS client has no secret.

Give both to the admin console#

This tells every Emergic app in your office which Google app to use. Open the admin console, find Mail and Calendar, and open Use your organisation's own Google app. Choose the JSON file with the file button (or paste the Client ID and Client secret into their boxes), then press Check with Google. It should say Looks right. Press Save. The console now says In use: Your organization's own Google app. For iPhones, open Use your organisation's own iPhone client, paste the iOS Client ID, and press Save the iOS client.

Each person signs in#

Mail now uses your app. On each computer or phone, the person chooses Mail, then Sign in with Google, signs in with their work account, and allows every permission Google lists. The sign-in then stays until they or you end it.

If Gmail is Restricted in your Workspace, Google blocks even an Internal app until you trust it: in Security → Access and data control → API controls → Manage Third-Party App Access, add your new Desktop client (and iOS client) as in "If your Workspace blocks the app" above, with Trusted. Most organizations never need this, because Google leaves Gmail unrestricted by default.

Personal Gmail addresses cannot sign in to an Internal app; Google says the app "can only be used within its organization". For them, choose the audience External and add each person under Audience → Test users. Google then lets only those test users sign in, at most 100 of them.

How these steps were checked: Emergic's own Google Cloud console and a real Google Workspace admin console were opened to confirm the API controls pages and the test-user list. The Internal-app steps follow Google's own help pages (audience and user type, control which apps access Workspace data). Google renames buttons now and then; if one reads differently, pick the nearest match.

iPhones

An iPhone signs in to Google with a second client, of type iOS, because iOS pauses the app while Google's page is open. Emergic's own iOS client is built in, so iPhones need nothing set up. The console shows which one is in use, under Mail and Calendar.

With your organization's own Google app, make its iOS client too (step 7 above) and paste its Client ID under Use your organisation's own iPhone client. Your own iOS client wins over Emergic's from each iPhone's next Google sign-in.

What the check covers

Check with Google confirms that Google knows the Client ID and that the secret matches it. It cannot see whether the two APIs are on or how the consent screen is set. If either is missing, the first person's sign-in shows Google's own message, such as "Gmail API has not been used in project … or it is disabled". Turn the API on and sign in again.

Switching between the two

  • After you add your own app, each person's device uses it from its next Google sign-in. Accounts signed in with Emergic's app keep working until then; when an account's sign-in ends, Mail asks the person to sign in to Google again.
  • Stop using your own Google app in the console removes it. Each device then switches back to Emergic's Google app at its next sign-in.
  • An office that added a Google client file with an earlier release keeps it, and nothing changes for its people.
  • A device keeps a sign-in client only when its office gave it. Any other client on the device, such as one saved by an earlier release from another Google project, is replaced by Emergic's Google app when Emergic starts and before each sign-in. Accounts signed in with the old client then sign in to Google once more.
  • To see which client a computer uses, open Settings, General, and read the line under Mail and Calendar. It names Emergic's Google app or your office's own, with its Google project number.

When Mail says "Google sign-in has ended"

Google ended the account's sign-in: the person removed Emergic's access in their Google account, or the office changed its Google app. Mail and Calendar stop updating, and the mail already on the device stays. Press Sign in to Google again in Mail and sign in with the same account.