# Sign-in methods and rules

###### Each app has its own sign-in methods and its own rules. A person gets in only by signing in with one of the app's methods and matching at least one of its rules.

Set both in the dashboard: open the app under **LocalCan Access → Apps**, then **Who may sign in**.

#### Sign-in methods

Google, Microsoft and GitHub are ready to use in every app. Your own identity provider, such as Okta, Keycloak, Authentik, Auth0 or JumpCloud, is added once under **LocalCan Access → Sign-in methods** and then chosen per app. An app can offer up to five methods. With one method, people go straight to it. With several, LocalCan shows a page where they pick one.

LocalCan counts an email address only where the provider is that address's authority. An address that doesn't count can still be blocked, but it never matches an email rule.

| Method | The email address that counts |
| --- | --- |
| Google | The address of a Google Workspace account, or a Gmail address. A Google account made with any other address doesn't count, because Google checked that address once, when the account was made. |
| Microsoft | The address of a member of the organization that signs them in, as Microsoft verified it. For a personal Microsoft account, only an address at outlook.com, hotmail.com, live.com or msn.com. A guest in another organization brings no address. |
| GitHub | The account's primary email, when GitHub has verified it. |
| Your identity provider | An address the provider marks as verified (`email_verified`), or any address when you turn on **Trust every email this provider sends, verified or not**. |

#### Rules

| Rule | Who it lets in | Needs |
| --- | --- | --- |
| Email address | One exact address. | Any method |
| Google Workspace domain | Everyone in the Google Workspace that owns the domain. The address's own domain is never enough. | Google |
| Microsoft tenant ID | Every member of that Microsoft Entra organization. Guests don't match. | Microsoft |
| Group, from your OIDC connection | Members of a group your identity provider sends. | Your provider, with a groups claim |
| Anyone from your OIDC connection | Everyone your identity provider signs in. | Your provider |

An app can have up to 200 rules. With no rule, nobody gets in. A rule the method can't check, such as a Google Workspace domain on an app without Google, is refused when you save it. Group names are compared in lowercase.

A change to the rules applies to people already signed in at their next request after the 60-second session check, so within 2 minutes.

#### Microsoft

Microsoft sign-in works for work and school accounts and for personal Microsoft accounts. Some organizations let only their admins approve new apps. People there see this message instead of signing in:

```plaintext
Your organization must approve LocalCan Access before you can sign in with Microsoft. Ask your IT admin.
```

An admin of that organization with the Privileged Role Administrator, Cloud Application Administrator or Application Administrator role approves LocalCan Access once, for everyone, at this address. Replace the first part with the organization's tenant ID or one of its verified domains:

```plaintext
https://login.microsoftonline.com/<tenant ID or domain>/adminconsent?client_id=482bb70a-3a57-4e5b-a59e-60acc7103a95
```

After the approval, Microsoft returns the admin to a LocalCan page that confirms it. People then sign in again from the app.

#### Your own identity provider (OIDC)

Add it under **LocalCan Access → Sign-in methods → Your identity provider (OIDC)**. Adding one needs LocalCan Access on the team, and a team can have up to 10.

1. In your identity provider, create a web application that uses the authorization code flow.
2. In the dashboard, select **Add OIDC connection** and enter its **Issuer URL** (https), **Client ID** and **Client secret**. Optionally add **Extra scopes**, and a **Groups claim** if you want group rules. LocalCan always asks for `openid email profile`.
3. Select **Add connection**. The dashboard shows the **Redirect URI** once: register it in your identity provider, and copy it before you select **Done**.
4. Select **Test** on the connection. The test link signs you in once and records which claims arrived, never their values, and signs no one in to any app. The result appears in the dashboard.

A connection's **Manage** menu turns it off or on, sets a new client secret and reloads the provider's settings. Turning a connection off signs out everyone who signed in with it.

LocalCan reads the provider's discovery document when you add it, and requires its issuer to match the URL exactly. The issuer can't change afterwards. Your provider must be reachable from the internet: LocalCan refuses to call private network addresses.

#### What people see on first sign-in

The first time a person signs in to an app with Google, Microsoft or GitHub, LocalCan shows a page that names the app and lists what the team will see: their name, their email, an ID for their account, and the times, IP address, country and browser of their sign-ins. Nothing about them reaches the team until they select **Continue**. A person the rules don't let in never sees this page, and the team gets no record of the attempt.

People who sign in through your own identity provider see no such page.

#### People, blocks and sign-out

**LocalCan Access → People** lists the people who signed in, up to the 1000 most recent sign-ins. Each person's menu has:

- **Block**, which stops an address on every app and every sign-in method, even where a rule allows it. It matches every address the provider states for the person, verified or not, and their sessions end within 2 minutes. To block an address before anyone signs in with it, use **Block email**. A block is recorded in the team's audit log.
- **Sign out of every app**, which ends a person's sessions on every app. They can sign in again unless they are blocked.

**Sign out everyone**, on an app's page, makes everyone sign in to that app again within 15 seconds. Service tokens keep working.

**LocalCan Access → Access log** lists the team's sign-in events, such as sign-ins and sign-outs, with the time, person, app and IP address. Entries are kept for 90 days.

A session lasts 24 hours unless you change **Sign people out after (hours, 1 to 168)**. A session keeps the length it started with.

#### How fast a change takes effect

| Change | Pages and requests | Open WebSockets and event streams |
| --- | --- | --- |
| A person signs out of the app | At once | At once |
| A person selects **Sign out of all apps**, on the other apps | Within 2 minutes | Within 70 seconds |
| Sign out everyone | Within 15 seconds | Within 30 seconds |
| Block, sign out a person, change a rule or a sign-in method | Within 2 minutes | Within 70 seconds |
| App turned off or deleted, or LocalCan Access ends | Within 15 seconds | Within 30 seconds |
| A session reaches its end | At once | Within 5 seconds |

If LocalCan's servers can't be reached, people already signed in keep working for up to 60 minutes after their last successful check. New sign-ins wait until LocalCan is back.

