Setting up NearAuth with Google Workspace
When you're done, people in one Google group (for example nearauth-users@your-domain.com) sign in to Google with NearAuth: Google sends their sign-ins to NearAuth, which checks that their phone is with them. Everyone else in your Workspace signs in to Google as usual, so you can start with a few people.
You'll need: a Google Workspace super administrator, access to Google Cloud console for your organization, a NearAuth administrator account whose email is in your Workspace domain, and about 30 minutes. Below, YOUR_COMPANY_ID stands for your Company ID, which is shown in the admin console. Sign in to see your company's own values filled in.

1. Let people sign in to NearAuth with Google
  1. In Google Cloud console > Google Auth Platform (OAuth consent screen), set the app up as Internal, so only people in your Workspace can use it.
  2. Under Clients (Credentials), create an OAuth client ID of type Web application with this authorized redirect URI:
    https://secure.nearauth.ai/login/oauth2/code/nearauth
  3. On NearAuth's Settings page, set Current Identity Provider Connection to Google Workspace, click Upload next to Google Workspace OAuth Data, and enter the client ID and client secret.

2. Add your people and set up their phones
There are two ways to add people. You can use both, and either way each person gets an email invitation, installs NearAuth on their phone and computer, and signs in with Google (instructions). Set yourself up first, so you can test before anyone else is switched over.
A. Add people one at a time (best for trying NearAuth with a few people)
  1. On the Users page, click Add User and enter the person's name and Google Workspace email (and, if they'll SSH to Linux servers, their UID).
  2. NearAuth emails them an invitation. They show up on the Users page as set up once their phone is registered.
You can also add people from your own systems with the user API.
B. Add everyone in a Google group (best for rolling out to a team or the whole company; needs step 3 first)
  1. Create (or pick) a Google group of the people to invite, for example nearauth-invite@your-domain.com. Use a different group from the NearAuth group in step 4: people in this one can still sign in to Google normally while they set up.
  2. On the Onboarding page, choose the group and click Use this group. NearAuth shows how many people will be invited and whether they fit in your licenses.
  3. Click Start inviting. NearAuth creates their accounts and emails invitations, reminds people who haven't set up every 3 days (up to 3 times), and invites anyone added to the group later.
  4. When someone finishes setting up, NearAuth adds them to the NearAuth group from step 4 for you (once step 7 is done). If someone leaves the group, they're flagged on the Onboarding page for you to deactivate or keep.

3. Connect your Workspace to NearAuth
  1. Pick the Google admin account NearAuth will act as (for example a dedicated nearauth-admin@your-domain.com). Give it an admin role that can manage group members (Groups Admin) and sign users out (User Management Admin, or a custom role with those privileges).
  2. On the Off-site sign-ins page, connect Google Workspace with your primary domain and that admin's email.
  3. In the Google Admin console > Security > Access and data control > API controls > Domain-wide delegation, click Add new:
    Client ID: (shown here when you're signed in to the admin console)
    OAuth scopes: https://www.googleapis.com/auth/admin.directory.group.readonly,https://www.googleapis.com/auth/admin.directory.group.member,https://www.googleapis.com/auth/admin.directory.user.security,https://www.googleapis.com/auth/admin.directory.domain.readonly,https://www.googleapis.com/auth/admin.directory.user.readonly
The scopes let NearAuth read your groups, add and remove members of the NearAuth group, sign people out of Google when their devices are reset, recognize your secondary and alias domains, and check that someone hasn't been suspended or deleted before signing them in to an app.

4. Create the NearAuth group
In the Google Admin console > Groups, create an empty group, for example nearauth-users@your-domain.com. Leave it empty for now: anyone in it will be sent to NearAuth when they sign in to Google.

5. Add NearAuth as Google's identity provider for that group
In the Google Admin console > Security > Authentication > SSO with third-party IdP, click Add SAML profile:
  • Name: NearAuth
  • IdP entity ID: https://secure.nearauth.ai/SAML2/SSO/YOUR_COMPANY_ID/EntityId
  • Sign-in page URL: https://secure.nearauth.ai/SAML2/SSO/YOUR_COMPANY_ID/samlSignin
  • Sign-out page URL: https://secure.nearauth.ai/SAML2/SSO/YOUR_COMPANY_ID/Signout
  • Verification certificate: download NearAuth's certificate and upload it.
Save. Google then shows its own SP details (Entity ID and ACS URL); you'll need them in the next step. Don't assign the profile to anyone yet. (NearAuth's full metadata is at https://secure.nearauth.ai/SAML2/SSO/YOUR_COMPANY_ID/nearAuthIdpMetadata.)

6. Tell NearAuth about Google
NearAuth only answers sign-ins for return addresses you've registered, so it needs Google's two values for the profile you created in step 5:
  1. In the Google Admin console > Security > Authentication > SSO with third-party IdP, under Third-party SSO profiles, click your NearAuth profile.
  2. In its SP details section, copy the Entity ID and the ACS URL. They look like:
    https://accounts.google.com/samlrp/rpid
    https://accounts.google.com/samlrp/rpid/acs
    (older profiles may show …/samlrp/metadata?rpid=… and …/samlrp/acs?rpid=…). Each profile has its own rpid, and NearAuth needs the exact form Google shows, so copy them exactly.
  3. On NearAuth's Service Providers page, add a service provider named Google with that Entity ID and ACS URL.

7. Choose the group in NearAuth
On the Google Workspace page, choose the group from step 4 (groups appear after NearAuth's first sync, within an hour, or right away with Sync now on the off-site page), then click Check NearAuth's access. Fix anything it reports before going on.
Before or after people sign up? Either works. If you choose the group first, NearAuth adds each person to it automatically as soon as they finish setting up. If you choose it later, click Add everyone who's set up in step 8 to add the people who already have. Being in the group only changes how they sign in to Google once the profile is assigned to the group in step 8.

8. Switch the group over
  1. In the Google Admin console's SSO page, under Manage SSO profile assignments, choose your NearAuth group and assign it the NearAuth profile. Leave everyone else on their current setting.
  2. Add yourself to the group (on the Google Workspace page, or in the Google Admin console's Groups) and test: in a private browser window, sign in to Gmail. Google should send you to NearAuth and back, with and without your phone nearby.
  3. Then add the others with Add everyone who's set up. Only people whose phone is set up are added; NearAuth also adds people after their first Google sign-in to NearAuth, and removes people when their devices are reset.
Only add people who have NearAuth on their phone: once they're in the group, they can't sign in to Google without it.

9. Optional
  • Check more often: in the Google Admin console, under Security > Access and data control > Google session control, set the web session duration to 1 hour for the organizational unit your NearAuth people are in, so Google asks NearAuth again every hour.
  • Invite automatically: on the Onboarding page, pick a Google group whose members NearAuth invites, reminds, and enforces once they're set up.
  • Off-site rules: on the Off-site sign-ins page, set what happens when people sign in away from your offices.
  • Other apps: point other SAML apps (Slack and so on) at NearAuth using the values on the Service Providers page.

If someone can't sign in: take them out of the NearAuth group on the Google Workspace page (or in Google's Admin console) and they sign in to Google as before. Questions: help@NearAuth.ai or 607-238-3533.