Corporate sign-in
This page is for whoever installs and maintains ITS and looks after your organization's Microsoft or Google. Whoever administers ITS uses the Corporate access screen; this page covers what must exist before it.
ITS uses OpenID Connect, server to server. With the feature off (the default), ITS doesn't talk to anything outside. When it's on, the API only talks to the provider when someone signs in: to discover the addresses, exchange the code and read the public keys.
What do I need to prepare first?
| Item | Why |
|---|---|
System address on https:// (in Settings > Notifications and email) | Microsoft and Google only accept http on localhost. The return address is built from it |
APP_SECRET_KEY in .env | The client secret is stored encrypted with it. If the key changes, register the secret again |
| Outbound network access from the API server | To login.microsoftonline.com (Microsoft), accounts.google.com and www.googleapis.com (Google), on port 443 |
| Organization domains registered | Corporate sign-in only works for emails from those domains |
What is the return address?
It's the system address plus the provider's path:
- Microsoft:
https://ideas.yourcompany.com/api/auth/sso/microsoft/callback - Google:
https://ideas.yourcompany.com/api/auth/sso/google/callback
The Corporate access screen shows the exact address, ready to copy. The address registered with the provider must be identical to it.
What if the server goes out through a proxy?
If the server only reaches the internet through a proxy, set this in .env:
NODE_USE_ENV_PROXY=1
HTTPS_PROXY=http://proxy.yourcompany.local:3128
NO_PROXY=localhost,127.0.0.1,db,api
Then bring the services up again (docker compose ... up -d). Without a proxy, set nothing.
How do I register ITS with Microsoft (Entra ID)?
ITS works with a single tenant, your organization's.
- In the Microsoft Entra admin center, open Applications > App registrations > New registration.
- Name:
ITS. Under Supported account types, choose Accounts in this organizational directory only (single tenant). - Under Redirect URI, choose the Web platform and enter the Microsoft return address.
- Under Overview, copy the Application (client) ID and the Directory (tenant) ID. On the ITS screen, they go in Client (application) ID and Tenant (directory) ID.
- Under Certificates & secrets > New client secret, create a secret and copy the Value (not the secret ID). It's shown only once.
- Under Token configuration > Add optional claim, choose the ID token type and select
email. That way the token carries the email. - To limit who can sign in: under Enterprise applications > ITS > Properties, turn on Assignment required and, under Users and groups, add the authorized group.
The default permissions (openid, profile, email) are enough; ITS reads nothing beyond the sign-in.
If the ITS administrator turns on Offer the profile photo, add the delegated permission Microsoft Graph > User.Read to the application (under API permissions). Without it, sign-in keeps working, but the photo doesn't come. ITS fetches the photo from the server, only at graph.microsoft.com, and doesn't keep the access token.
How do I register ITS with Google?
- In the Google Cloud Console, choose (or create) a project and open APIs & Services > OAuth consent screen.
- Under User type, choose Internal, which restricts access to your Google Workspace, and fill in the app name and the support email.
- Under Credentials > Create credentials > OAuth client ID, choose the Web application type.
- Under Authorized redirect URIs, enter the Google return address.
- Copy the Client ID and the Client secret.
- To limit who can sign in, control access to the app by organizational unit in the Google Workspace Admin Console.
ITS only accepts Workspace accounts from the registered domains. A personal account (gmail.com) can't sign in.
What do I do when the secret expires?
The client secret expires. On Microsoft, it lasts 24 months at most. Note the date and enter it in Secret expiry date, on the Corporate access screen, so ITS health warns you before it expires.
When the secret expires, corporate sign-in stops working. Create a new secret at the provider and register it in Corporate access. Meanwhile, people with emergency access (the administrators) keep signing in with a password. Replacing the secret turns the provider off: after saving the new one, run the test and click Turn on, and corporate sign-in is back to normal.
What do I do when sign-in fails?
The reason appears on the sign-in screen and is recorded in Audit as Corporate account sign-in refused.
| Message or symptom | What to check |
|---|---|
| "The provider did not finish the sign-in" | Is the registered return address identical to the one on the screen? Has the secret expired? See logs api |
| "We could not reach the provider" | Outbound network access to the provider (firewall and proxy). Use Test address on the screen |
| "This account does not belong to the organization" | Is the account from another tenant? Is the tenant ID on the screen the one for the right directory? |
| "This account's email is not from one of the organization's domains" | Is the domain on the list? On Google, is the account a Workspace account and not a personal one? |
| "Your email is not registered in ITS yet" | Register the person under Users or turn on automatic creation |
Everyone refused after changing APP_SECRET_KEY | ITS can no longer read the registered secret: register it again |
| Nobody can sign in in SSO only mode | An administrator signs in with a password, changes the mode to Password only and fixes the problem |