authcha learn

Learn / Identity and security

Authcha as an identity provider

Module 4 of 5 · 30 minutes

By the end you can

  • Explain what an identity provider does and what Authcha offers
  • Register a server-side and a browser or phone application
  • Choose scopes and read the claims an application receives
  • Manage an application: switch off, rotate the secret, restrict who may sign in

The idea

People already have an Authcha account for network devices. Authcha can also sign them in to your applications, such as webmail, a wiki, a ticketing system or software you wrote, by acting as a standard OpenID Connect (OIDC) provider. Any application that offers "Sign in with OpenID Connect", "OIDC" or "generic OAuth 2" can use it.

  • Passkey first. People use the passkey they already enrolled: fingerprint, face or PIN, nothing to phish.
  • One account. The same directory, user types, numbers and passkeys. Lock or delete a user once and every application stops accepting them.
  • Single sign-on. After one sign-in, people move between applications without signing in again, for up to 8 hours.
  • Standard. Authorization code flow with PKCE, signed tokens any OIDC library can verify, discovery, refresh, revocation and logout.

This needs the Identity Provider module (Professional and Enterprise).

Requirements

APP_URL in .env must be the https:// address people use, with a DNS name, such as https://id.example.com. It becomes the issuer. Users need enrolled passkeys (or you allow the password-and-code fallback per application). Applications call Authcha's endpoints server to server, so their hosts must trust Authcha's certificate.

Everything an application needs is in one discovery document: https://id.example.com/.well-known/openid-configuration. The console shows it with a copy button under Integrations → Applications. Only the authorization code flow is supported. Implicit and hybrid flows are not.

Register an application

Integrations → Applications → Add application.

  1. Enter a name. People see "Sign in to name".
  2. Choose the type:
  3. Runs on a server (confidential): the application can keep a client secret. Webmail, wikis and most self-hosted software.
  4. Runs in the browser or on a phone (public): single-page and mobile apps. No secret, so the application must use PKCE.
  5. Enter the redirect URIs, one per line, also called callback URLs. They are compared character for character, with no wildcards, and Authcha never redirects anywhere else.
  6. Optionally open Advanced, then Add application.
  7. Copy the client ID and, for a server-side app, the client secret. The secret is shown once, and Authcha stores only a hash.

Advanced settings

SettingDefaultMeaning
Scopesopenid profile emailWhich scopes the application may request
Access-token audiencenoneValues in the token's aud claim. A server that validates tokens itself expects its own name
Access-token lifetime10 minutesHow long an access token is valid
Stay signed in for30 daysRefresh-token lifetime, extended each use
Your own applicationoffSkips the consent screen. For applications your organisation runs
Allow password and one-time codeoffA fallback for people without a passkey
Who may sign inevery user typeRestrict to some user types
Post-logout redirect URIsnoneWhere the app may send people after sign-out

Scopes and claims

An application asks for scopes, and each releases certain claims. openid is always required.

ScopeClaims
openidsub: a stable, opaque identifier that is never the username and never changes
profilepreferred_username, name
emailemail, email_verified
groupsgroups: the person's user type
offline_accessAllows a refresh token

email_verified is true only when an administrator set the address or it came from your directory. Use sub as the key for the person's account in your application, and preferred_username for display and matching existing accounts. The ID token also carries auth_time, amr (how they signed in: a passkey is hwk with user, password and code is pwd with otp) and sid.

Manage applications

  • Switch off stops all new sign-ins at once, keeping the settings.
  • Rotate secret issues a new secret, shown once. The old one stops immediately, so update the application straight away.
  • Delete removes the application and its sign-ins permanently.
  • The type cannot be changed. Add a new application instead.

Every change is recorded in the audit trail.

LabHands-on

On the demo as demo-admin (password Authcha-Demo-2026) you can look at the list, and on your install you can do all of it.

  1. Open Integrations on the demo and find Applications. Look at the discovery URL.
  2. On your install, fetch the discovery document with curl -s https://<host>/.well-known/openid-configuration | head -30 and find the authorization, token and JWKS endpoints.
  3. Register a test confidential application with one redirect URI. Save the client ID and secret.
  4. Open the OIDC playground at /oidc/playground on your install (if present) or use any OIDC test client, and sign in with a passkey.
  5. Decode the ID token and check sub, preferred_username and amr.
  6. Rotate the secret and confirm the old one stops working. Then switch the application off and confirm a new sign-in is refused.

Check yourselfQuiz

1What should an application use as the key for a person's account?
2What is a public client?
3How are redirect URIs compared?
4You rotate an application's client secret. What happens to the old one?
5Which OIDC flow is supported?

Cheat sheetKeep this

  • Authcha = OIDC provider. Needs the Identity Provider module and APP_URL = https://<DNS name>.
  • Discovery: /.well-known/openid-configuration. Flow: authorization code + PKCE only.
  • Register under Integrations → Applications. Confidential = has a secret (shown once). Public = PKCE.
  • Redirect URIs: exact match, no wildcards.
  • Scopes: openid (required), profile, email, groups, offline_access. Key accounts on sub.
  • Lifetimes: access token 10 min, refresh 30 days, SSO up to 8 h.
  • Read more: Identity provider.