Checkin can let people sign in with an existing Google, GitHub or Microsoft account instead of typing their Checkin password. The feature is built on Laravel Socialite (Google and GitHub) and socialiteproviders/microsoft (Microsoft personal and work/school accounts). It is off until you configure it: each provider appears on the login page only once its client id and secret are set.
- Is it worth it here?
- What people see
- How a sign-in works
- The rules
- Connecting and disconnecting
- Setting up the providers
- Configuration
- Security notes
- Audit log
- Troubleshooting
- Where the code lives
Is it worth it here?#
Checkin is the identity provider for every other application: an external account that can sign in to Checkin can sign in to all of them. So the question is not "is it convenient?" but "is that external account at least as safe as a Checkin password?".
| For | Against |
|---|---|
| One click for people who already live in Google Workspace, Microsoft 365 or GitHub | Every connected Google/GitHub/Microsoft account becomes another key to every app |
| No password to remember, or to reset | Checkin depends on the provider being up and on its OAuth app staying configured |
| The provider's own protections (its 2FA, device checks, Workspace/Entra policies) apply | Checkin cannot see whether the person used 2FA at the provider |
| Disabling the person at the provider (e.g. leaving the company) stops that route in | It does not stop the password or passkeys: suspending the person in Checkin is still what locks them out |
Recommendation
- Worth enabling when the people are already managed somewhere else — a company on Google Workspace or Microsoft 365 (with
MICROSOFT_TENANTset to that tenant), or a team of developers who all use GitHub with 2FA turned on. - Not worth it for a handful of people who already use passkeys: a passkey is phishing-resistant and needs no third party, so it is the better "no password" option. Leave the variables empty and nothing changes.
- Whatever you choose, ask people with access to sensitive applications to turn on TOTP in Checkin: it is still asked after a Google/GitHub/Microsoft sign-in (see below).
This is why the implementation is opt-in per provider, never creates accounts, and keeps Checkin's second factor.
What people see#
On the login page, under the passkey button, one button per enabled provider ("Google", "GitHub", "Microsoft"; "Continue with Google" when only one is enabled), then Or continue with email and the usual form.
In Settings → Security, a Connected accounts section lists the enabled providers with, for each one, the connected identity (e-mail or GitHub handle, last use) and a Connect or Disconnect button.
In Administration → People → a person, a Connected accounts card lists the identities connected to that person, each with a button to disconnect it.
Nothing is shown anywhere while no provider is configured.
How a sign-in works#
Browser Checkin Google / GitHub / Microsoft
│ click "Google" │ │
│ ───────────────────────────────▶│ GET /auth/google/redirect │
│ │ state → session, redirect ─────────────────────▶│
│ │ │ person signs in there
│◀────────────────────────────────────────────────────────── redirect with code+state │
│ ───────────────────────────────▶│ GET /auth/google/callback?code&state │
│ │ checks state, swaps code for a token ──────────▶│
│ │ reads the profile (id, e-mail, name) ◀──────────│
│ │ social_accounts: (google, id) → person? │
│ │ ├─ none → back to /login with a message │
│ │ ├─ TOTP on → /two-factor-challenge │
│ │ └─ otherwise → signed in │
│◀────────────────────────────────│ redirect to the intended URL or /dashboard │Step by step:
GET /auth/{provider}/redirect(guests only). Socialite stores a randomstatein the session and sends the browser to the provider's consent page, withAPP_URL/auth/{provider}/callbackas the return address.- The person signs in at the provider (with whatever the provider asks: password, its own 2FA, a Workspace/Entra policy…) and approves Checkin the first time.
GET /auth/{provider}/callback. Socialite checksstate(CSRF protection), exchanges thecodefor an access token server-to-server and reads the profile: a stable id (Googlesub, GitHub numeric id, Microsoft object id), the e-mail, name, handle and avatar. The provider's token is used for that single request and then thrown away: Checkin stores no provider token.- Checkin looks up
social_accountsby (provider, provider id). The e-mail is not the key: people change addresses, and an e-mail match is only used in the optional case described in link by e-mail. - No connected person → back to
/loginwith "No account is connected to this Google account…", and a Failed sign-in row in the audit log. No account is created, whateverCHECKIN_REGISTRATIONsays. - Connected person with TOTP enabled → the same hand-off Fortify uses after a correct password:
login.idgoes in the session and the person lands on/two-factor-challenge. The code (or a recovery code) completes the sign-in. - Otherwise →
Auth::login(), session id regenerated, and Fortify'sLoginResponsesends the person to the intended URL: when they came from an application, that is/oauth/authorize?…, so the single sign-on continues exactly as after a password sign-in. - The
Loginevent writes the audit log (method: google) and updateslast_login_at, which applications receive asauth_time.
From the applications' point of view nothing changes: they still talk OpenID Connect to Checkin, receive the same sub (the person's Checkin UUID) and the same claims. They never learn that the person used Google.
The rules#
| Rule | Why |
|---|---|
| A provider is enabled only when both its client id and secret are set | Opt-in, per provider; empty variables = feature invisible, routes answer 404 |
| An external identity never creates a Checkin account | Checkin is invite-only; administrators decide who has an account |
| An identity signs in only once it is connected to a person | Explicit, auditable link between "this Google account" and "this person" |
| One identity → one person; one identity per provider per person | Unique (provider, provider_id) and (user_id, provider) in social_accounts |
| TOTP still applies after a provider sign-in | The provider replaces the password, not Checkin's second factor |
| Suspension, access per application, consent: unchanged | Enforced at /oauth/authorize for every sign-in method |
| "Remember me" is not offered for provider sign-ins | The session lasts SESSION_LIFETIME; people return through the provider in one click anyway |
| Profile data (name, e-mail, avatar) is refreshed on each sign-in, only on the connection | The Checkin profile (what applications see) is never overwritten by a provider |
| No provider token is stored | Checkin only needs to know who signed in, once |
Connecting and disconnecting#
By the person (the default way)#
- Sign in to Checkin as usual (password or passkey, plus TOTP).
- Settings → Security → Connected accounts → Connect next to the provider. Checkin asks to confirm the password if it was not confirmed recently (
password.confirm), then goes to the provider and back. - The identity is now connected; from the next sign-in the provider's button works.
If that identity is already connected to someone else, Checkin refuses: "This GitHub account is already connected to another person." Connecting again the same provider with a different identity replaces the previous one.
Disconnect removes the connection immediately. The password, passkeys and TOTP are not touched.
By an administrator#
Administrators cannot connect an identity for someone (they would need that person's Google password), but they can disconnect one from the person's page — for example when the person reports their Google account stolen. Suspending or deleting the person also stops every route in; deleting removes the connections (ON DELETE CASCADE).
Link by e-mail (optional)#
With CHECKIN_SOCIAL_LINK_BY_EMAIL=true, the first sign-in with Google or GitHub also connects the identity to the Checkin account with the same e-mail address, when:
- the provider vouches for the address: Google's
email_verifiedis true; GitHub returns only verified addresses (Socialite asks for the primary verified one); - that account has no identity of that provider connected yet.
Microsoft is never matched by e-mail: the address it returns is the user principal name, which any Entra tenant administrator can set to any value, including your users' addresses (the "nOAuth" class of account takeover). Microsoft identities are connected only from Settings → Security.
This option makes invitations smoother (an administrator adds ada@company.com, Ada clicks Google and is in, without ever setting a password) at the price of trusting the provider's e-mail verification for the very first connection. It is off by default; turn it on when your people's addresses live on Google Workspace or GitHub accounts you trust.
Setting up the providers#
The callback URL is always {APP_URL}/auth/{provider}/callback, e.g. https://checkin.example.com/auth/google/callback. Register one per environment (https://checkin.test/... locally).
Google#
- Google Cloud Console → create or pick a project → APIs & Services → OAuth consent screen: user type External (any Google account) or Internal (Workspace only — then only your organisation's accounts can use it), app name "Checkin", support e-mail, scopes
openid,email,profile. - Credentials → Create credentials → OAuth client ID → Web application.
- Authorized redirect URIs:
https://checkin.example.com/auth/google/callback. - Copy the client id and secret:
GOOGLE_CLIENT_ID=1234567890-abc.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=GOCSPX-...
An External app in "Testing" status only accepts the test users you list; publish it (no verification is needed for these basic scopes).
GitHub#
- GitHub → Settings → Developer settings → OAuth Apps → New OAuth App (under an organisation's settings to own it as the organisation).
- Homepage URL:
https://checkin.example.com; Authorization callback URL:https://checkin.example.com/auth/github/callback. - Generate a new client secret and copy both values:
GITHUB_CLIENT_ID=Ov23li... GITHUB_CLIENT_SECRET=...
Socialite asks for the user:email scope (read-only access to the addresses, used to find the verified primary one). A GitHub App works too, but a plain OAuth App is all this needs.
Microsoft (personal, work and school accounts)#
- Microsoft Entra admin center → Identity → Applications → App registrations → New registration.
- Supported account types: pick who may sign in — this must agree with
MICROSOFT_TENANT: | Account types in Entra |MICROSOFT_TENANT| | :--- | :--- | | Accounts in this organizational directory only | your tenant id (recommended for a company) | | Accounts in any organizational directory |organizations| | Any organizational directory and personal Microsoft accounts |common(default) | | Personal Microsoft accounts only |consumers| - Redirect URI: platform Web,
https://checkin.example.com/auth/microsoft/callback. - Certificates & secrets → New client secret; copy the Value (not the Secret ID). Note the expiry date: Entra secrets expire (6–24 months) and sign-in with Microsoft stops when they do.
- API permissions:
User.Read(delegated, present by default) is enough.MICROSOFT_CLIENT_ID=00000000-0000-0000-0000-000000000000 # Application (client) ID MICROSOFT_CLIENT_SECRET=... MICROSOFT_TENANT=11111111-1111-1111-1111-111111111111 # or common / organizations / consumers
After changing .env in production, run php artisan config:cache.
Configuration#
| Variable | Default | Role |
|---|---|---|
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET | — | Enable "Google" when both are set |
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET | — | Enable "GitHub" when both are set |
MICROSOFT_CLIENT_ID / MICROSOFT_CLIENT_SECRET | — | Enable "Microsoft" when both are set |
MICROSOFT_TENANT | common | Which Microsoft accounts may sign in: a tenant id, organizations, consumers or common |
CHECKIN_SOCIAL_LINK_BY_EMAIL | false | Connect a Google/GitHub identity to the account with the same verified e-mail on first sign-in |
The values live in config/services.php (google, github, microsoft) and config/checkin.php (social.link_by_email). To turn a provider off, empty its id or secret: the button disappears, its routes answer 404, connections stay in the database and work again if you turn it back on. Disconnect people explicitly if you want them gone.
Routes (rate limited to 20 requests per minute per IP, throttle:social):
| Route | Middleware | Purpose |
|---|---|---|
GET /auth/{provider}/redirect | guest | Start a sign-in |
GET /auth/{provider}/link | auth, password.confirm | Start connecting the provider to the signed-in account |
GET /auth/{provider}/callback | — | Return from the provider, for both |
Security notes#
- Equivalent to a password, not to a passkey. A Google/GitHub/Microsoft session can be phished like a password can; the provider's own 2FA helps, but Checkin cannot see whether it was used. Checkin's TOTP is therefore still asked. Passkeys remain the strongest option.
- The OIDC
amrclaim is unchanged. It describes the methods set up on the account (pwd,otp,hwk), not the method used for this sign-in; applications that need to know exactly how someone signed in should not rely on it. - State and CSRF. The
stateparameter is checked on every callback; a missing or reused one ends at the login page with "The Google sign-in expired". - Provider e-mail trust. Only Google (
email_verified) and GitHub (verified addresses) are trusted, and only withCHECKIN_SOCIAL_LINK_BY_EMAIL=true. Microsoft never is. - Restrict who may even try. Google Internal consent screen or Microsoft single-tenant registration keep strangers away before they reach Checkin; with a plain
common/External setup, anyone can authenticate at the provider but still finds no connected account. - Secrets. Client secrets are server-side only. Rotate them at the provider and update
.env; Microsoft secrets expire on their own. - Leaving. Removing someone from Google Workspace / Entra blocks that route in, not the others. Suspend the person in Checkin to lock them out everywhere.
Audit log#
| Event | Context |
|---|---|
| Signed in | method: google, github or microsoft (also when the sign-in completes at the two-factor challenge) |
| Failed sign-in | method: the provider, reason: not_connected; email: the address the provider returned |
| Account connected | provider; by: email when connected by link by e-mail |
| Account disconnected | provider; by: the administrator's e-mail when an administrator did it |
Troubleshooting#
| Symptom | Cause / fix |
|---|---|
| No button on the login page | Id or secret missing; php artisan config:clear (or config:cache in production) after editing .env |
Google redirect_uri_mismatch, Microsoft AADSTS50011, GitHub "redirect_uri is not associated" | The callback registered at the provider must be exactly APP_URL/auth/{provider}/callback, same scheme and host |
| "The … sign-in expired" | The session cookie did not survive the round trip: check APP_URL, SESSION_DOMAIN, SESSION_SECURE_COOKIE (HTTPS), and that the browser was not switched between the two halves |
| "No account is connected to this … account" | Expected for unknown identities: the person signs in another way and connects the provider from Settings → Security (or turn on link by e-mail for Google/GitHub) |
Microsoft AADSTS50020 / AADSTS50194 | MICROSOFT_TENANT does not match the Supported account types of the app registration |
| Microsoft stopped working after months | The client secret expired: create a new one in Entra |
Where the code lives#
| File | Role |
|---|---|
app/Enums/SocialProvider.php | The three providers, isEnabled(), which e-mail each one vouches for |
app/Http/Controllers/Auth/SocialLoginController.php | Redirect, connect, callback: sign-in, two-factor hand-off, connection |
app/Models/SocialAccount.php + social_accounts table | Connected identities (no tokens) |
routes/web.php | The three routes, throttle:social |
app/Providers/AppServiceProvider.php | The Microsoft driver (SocialiteWasCalled), the social rate limiter |
app/Listeners/AccessLogSubscriber.php | method of the Signed in row |
resources/views/components/social-login.blade.php, social-icon.blade.php | Login buttons and brand icons |
resources/views/pages/settings/⚡security.blade.php | Connected accounts for the person |
resources/views/pages/admin/⚡user-form.blade.php | Connected accounts for administrators |
tests/Feature/Auth/SocialLoginTest.php | The behaviour above, with Socialite mocked |
To add another provider (GitLab, Apple, Keycloak…): add a case to SocialProvider (label, e-mail trust — false unless the provider states verification), its block in config/services.php, an icon in social-icon.blade.php, and, for a SocialiteProviders package, its SocialiteWasCalled listener in AppServiceProvider.
