# Single sign-on with Google and Microsoft

> Let your team sign in with Google or Microsoft, connect your Microsoft directory, and let people from your company join automatically.

People can sign in to Lagotto with their Google or Microsoft account instead of a password. Administrators set it up under **Settings → Security**. Passwords keep working alongside it.

## How it works for your team

When single sign-on is available, the workspace's sign-in page shows **Continue with Google** or **Continue with Microsoft** above the password form.

1. Select the button.
2. Lagotto briefly shows "Taking you to Google to sign in" (or Microsoft) and sends you on.
3. Sign in with your company account.
4. You come back to your workspace, signed in.

The first time, Lagotto matches your Google or Microsoft account to your seat by email address. After that it remembers that account for you in this workspace. If an administrator changes your email address in Lagotto, it forgets the account and matches again by the new address the next time you sign in.

People still need a seat: an administrator adds them under **Settings → Team** first, unless you let people join automatically (see [Letting people join automatically](#letting-people-join-automatically)).

## Google

Google sign-in needs no setup. Lagotto accepts a Google account only when Google confirms it has verified the email address.

## Microsoft

Microsoft sign-in is offered only once you tell Lagotto which Microsoft directory your company uses. Any directory's administrator can set its users' email addresses to anything, so Lagotto trusts a Microsoft account only when it comes from your directory.

1. In the Microsoft Entra admin center, copy your **Tenant ID** from the overview page. It looks like `00000000-0000-0000-0000-000000000000`.
2. In Lagotto, go to **Settings → Security**.
3. Paste it into **Microsoft directory (tenant) ID**.
4. Select **Save**.

**Continue with Microsoft** then appears on your sign-in page, for accounts in that directory only. To turn Microsoft sign-in off, clear the field and save.

## Letting people join automatically

If you trust everyone at your company's email domains, you can let them join without being added first.

1. Go to **Settings → Security**.
2. Enter at least one domain under **Allowed email domains**, such as `acme.com`.
3. Turn on **Let anyone at these domains join with single sign-on**.
4. Select **Save**.

Now someone at an allowed domain who signs in with Google or Microsoft and has no seat gets one, as **Read only**, named as their Google or Microsoft account names them. An administrator can give them another role under **Settings → Team**. Each joins as a read-only seat, which is billed.

- It does nothing without at least one allowed domain
- Someone who has been deactivated is never re-added this way
- Each person who joins this way is recorded in the [audit log](https://www.lagottolabs.ai/support/people-and-security/audit-log.md)

## When sign-in is refused

The sign-in page says why:

- **"We couldn't confirm your email address with Google"** (or Microsoft). Google hasn't verified the address, or the Microsoft account isn't in your directory.
- **"… isn't allowed to sign in to this workspace."** The address is outside your [allowed email domains](https://www.lagottolabs.ai/support/people-and-security/allowed-email-domains.md).
- **"Your address in this workspace is outside its allowed email domains. Ask an admin to change it."** The Google or Microsoft account is fine, but the address on the person's seat in Lagotto isn't at an allowed domain. An administrator changes it under **Settings → Team**.
- **"… doesn't have a seat in this workspace. Ask an admin to add you."** Nobody has added that address.
- **"… has been deactivated in this workspace. Ask an admin to reactivate you."**
- **"That sign-in method isn't available."** The button was used where that provider isn't set up.

Failed single sign-on attempts are recorded in the audit log with the reason.

## Passwords and single sign-on together

Single sign-on doesn't switch passwords off. Someone added under **Settings → Team** still gets the welcome email with a password link, and anyone at an allowed address can use **Forgot password?**. People who only use single sign-on can set a password later on their [profile](https://www.lagottolabs.ai/support/getting-started/your-profile.md). To limit who can sign in by any method, use [allowed email domains](https://www.lagottolabs.ai/support/people-and-security/allowed-email-domains.md).
