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
- 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.
- 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
- 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)
- 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).
- 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)
- 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.
- 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.
- 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.
- 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
- 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).
- On the Off-site sign-ins page, connect Google Workspace with your primary domain
and that admin's email.
- 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
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:
- In the Google Admin
console > Security > Authentication > SSO with third-party IdP, under
Third-party SSO profiles, click your NearAuth
profile.
- 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.
- 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
- 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.
- 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.
- 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.