OpenID Connect
OkYouIn is an OpenID Connect provider (OP) for web applications. The application sends the browser to OkYouIn; the user signs in on OkYouIn’s branded sign-in page with the password and, if the rules require it, a second factor; OkYouIn sends the browser back with an authorization code, which the application exchanges for an ID token.
One sign-in serves every OIDC and SAML application: the second application the user opens signs in without a prompt while the OkYouIn session is alive.
Step-by-step setups: Grafana, GitLab and any OIDC application.
Requirements
Section titled “Requirements”- The server’s public URL (Settings ▸ General) must be an
https://address. It defines the issuer; without it every/oidc/endpoint answers503and the application’s Connect tab shows a warning. - The relying party must be reachable by the user’s browser over HTTPS: OkYouIn accepts
httpsredirect URIs only (httponly forlocalhost,127.0.0.1and[::1]).
Issuer and endpoints
Section titled “Issuer and endpoints”The issuer is the public URL followed by /oidc — for example https://mfa.example.com/oidc.
Access ▸ Settings ▸ Single sign-on shows it together with the discovery URL.
| Endpoint | Path |
|---|---|
| Discovery | https://mfa.example.com/oidc/.well-known/openid-configuration |
| Authorization | https://mfa.example.com/oidc/authorize |
| Token | https://mfa.example.com/oidc/token |
| Userinfo | https://mfa.example.com/oidc/userinfo |
| JWKS | https://mfa.example.com/oidc/jwks |
| End session | https://mfa.example.com/oidc/end_session |
What the provider supports, as published in discovery:
| Supported | |
|---|---|
| Flow | Authorization code (response_type=code, response_mode=query) |
| Grant types | authorization_code — no refresh tokens |
| Client authentication | client_secret_basic, client_secret_post, none (public clients) |
| PKCE | S256 (plain is refused) |
| ID token signing | RS256 |
| Scopes | openid, profile, email, groups |
prompt | none, login |
| Logout | RP-initiated logout (end_session_endpoint); front-channel and back-channel logout are not supported |
ID tokens and access tokens are valid for 10 minutes; an authorization code for 60 seconds. There is no refresh token: the application starts a new authorization when it needs one, which the live OkYouIn session answers without a prompt.
Creating a client
Section titled “Creating a client”Create the application from the Generic OIDC template or a product template (Access ▸ Applications ▸ Add application). The OIDC settings:
| Setting | Meaning |
|---|---|
| Client type | Confidential (client secret) — a server-side application that keeps the client secret. Public (PKCE, no secret) — a browser or mobile application that cannot keep a secret; it must use PKCE. |
| Redirect URIs | One per line. The application’s callback must match one exactly — no wildcards, no fragments. |
| Post-logout redirect URIs | One per line. Where the application may send the browser after signing out of OkYouIn; empty = the OkYouIn “Signed out” page. |
| Client ID | Generated. |
| Client secret | Generated for confidential clients. Stored encrypted; revealing it is audited. |
| Require MFA | Off: sign-ins the policy allows get in without a second factor. |
| Session lifetime (hours) | How long one MFA serves this application. After it, the next sign-in to this application asks for the second factor again, even if the OkYouIn session is still alive. |
PKCE is mandatory for a public client and checked whenever a confidential client sends a
code_challenge.
Claims
Section titled “Claims”Claims depend on the scopes the client requests and are the same in the ID token and the userinfo answer:
| Scope | Claims |
|---|---|
openid | sub (the OkYouIn user ID — stable across renames), plus iss, aud, azp, exp, iat, auth_time, nonce (when sent), amr |
profile | preferred_username, name, given_name, family_name |
email | email when the user has one; email_verified is not sent |
groups | groups — the names of the user’s groups, local and directory, sorted |
For a directory user, preferred_username is the qualified name — for an Active Directory
user typically the UPN (alice@corp.example.com). Userinfo reads the user’s data at the
moment of the call, so a group change shows up at the next call.
Claims from application rules
Section titled “Claims from application rules”Application rules can add claims of their own — for example role: Admin for members of a
group. They are added to every ID token and userinfo answer, whatever scopes the client asks
for. A name given several times becomes a list; template claims a rule leaves out are sent
with their default. Protocol, standard and scope claims, groups and names starting with
okyouin: are reserved.
{ "sub": "4f6c1e0a-3b7d-4c2e-9a51-0d2b8f7e6c11", "preferred_username": "alice@corp.example.com", "name": "Alice Example", "email": "alice@example.com", "groups": ["DevOps", "VPN-users"], "role": "Admin"}The sign-in
Section titled “The sign-in”-
The application redirects to
/oidc/authorize. OkYouIn checks the client, the redirect URI and the request, and evaluates the policy for this application and the browser’s address. -
Without a live OkYouIn session the browser lands on the sign-in page: username and password, then the second factor — a code field for TOTP or an e-mailed code, a number to pick for Web Push with number matching, or a wait for Telegram or an e-mail Approve link. A user without a method gets an enrolment link if self-service is on.
-
OkYouIn redirects back with the code. The application exchanges it at
/oidc/tokenand receivesid_tokenandaccess_token. -
The next application — or the same one later — finds the OkYouIn session and is signed in without a prompt, unless that application’s session lifetime has passed since the last MFA (then only the second factor is asked) or the policy now says otherwise.
The policy is evaluated on every authorization request and after every MFA, with the
browser’s current address — network and country conditions see where the user is now. A
denied user sees OkYouIn’s message and a “Back to” link to the application, which then
receives error=access_denied. With prompt=none, a sign-in that would need the password
or MFA answers login_required or interaction_required instead of showing a page.
Kerberos-capable Active Directory sites can replace the password step with the user’s Windows ticket: see Kerberos desktop SSO.
Sessions
Section titled “Sessions”Access ▸ Settings ▸ Single sign-on sets how long a browser stays signed in to OkYouIn:
| Setting | Default |
|---|---|
| Hours after which a single sign-on session ends and the password is asked again | 12 (1–720) |
| Minutes of inactivity after which a single sign-on session ends | 120 (5–10080) |
After either end, the next sign-in asks for the password again. How long one MFA serves an application is that application’s own Session lifetime (hours).
Logging ▸ SSO sessions lists live OkYouIn sessions: user, sign-in time, last seen, end, last MFA and the applications used. Every sign-in, MFA round, replayed code and sign-out is in Logging ▸ SSO sign-in log.
Sign-out and revoke
Section titled “Sign-out and revoke”There are two kinds of session, and it matters which one ends:
- the OkYouIn session — the browser’s single sign-on to OkYouIn;
- the application’s own session — the cookie Grafana, GitLab or your app keeps after the sign-in.
RP-initiated logout
Section titled “RP-initiated logout”Point the application’s logout to the end session URL:
https://mfa.example.com/oidc/end_session?id_token_hint=<ID-TOKEN>&post_logout_redirect_uri=https://app.example.com/loginWith a valid id_token_hint, OkYouIn ends its session without asking and redirects to the
post_logout_redirect_uri (if it is one of the application’s Post-logout redirect URIs)
or to its own “Signed out” page. Without a hint OkYouIn first asks “Sign out?” — protection
against a forged logout link. With no live OkYouIn session there is nothing to end, and the
browser goes straight on.
Revoke in the console
Section titled “Revoke in the console”Logging ▸ SSO sessions ▸ Revoke (or Revoke all of this user) ends the OkYouIn session at once: the codes and access tokens it issued stop working, and the browser’s next sign-in to any application asks for the password again. Locking a user, disabling them, changing their password or resetting their MFA does the same.
Signing keys
Section titled “Signing keys”ID tokens are signed with the active key (RSA 2048, RS256). Access ▸ Settings ▸ Single
sign-on lists the keys with their key ID, state and whether they are published in JWKS.
- The active key is replaced automatically after the configured number of days (90 by default; 0 = manual only).
- Rotate now — a new key signs from now on; the previous one stays in JWKS for 7 days, so nothing breaks for the applications.
- Rotate and drop previous — for a key that may be compromised: the previous key leaves JWKS at once and every token signed with it stops verifying. Most applications fetch JWKS again on an unknown key ID; others need a restart.
Troubleshooting
Section titled “Troubleshooting”| Symptom (SSO sign-in log reason) | Cause |
|---|---|
| Redirect URI not registered | The application sends a callback that is not exactly in Redirect URIs — check scheme, host, port, path and trailing slash. |
| HTTPS required | The application or a proxy reached OkYouIn over plain HTTP. |
| PKCE required | A public client sent no code_challenge. |
| Wrong client secret / Invalid client authentication | The secret on the application differs, or it sends the secret both in the header and the body. |
| Invalid scope (no openid) | The client did not request the openid scope. |
| Post-logout redirect URI not registered | The logout target is not in Post-logout redirect URIs; OkYouIn shows its own “Signed out” page instead. |
| Denied by policy | No policy rule allows this user for this application from this address. |
OkYouIn’s provider passes the OpenID Foundation conformance suite’s Basic OP and Config OP plans in our lab (self-run; this is not a certification) — see Generic OIDC.