Keyway SSO for Craft CMS › Guides
SSO-only login in Craft CMS is a one-line setting. Keeping a way back in when the identity provider has a bad morning is the part that needs planning — and it is the part this plugin refuses to let you skip.
It refuses a password sign-in on the control panel when the form is submitted. Precisely, and the precision matters when you are deciding whether this is safe to turn on:
The refusal message is "This site requires single sign-on. Use the sign-in button on this screen." — unless preventUserEnumeration is on, in which case both the message and the error code fall back to Craft's generic "Invalid username or password.", which is indistinguishable from a wrong password.
The plugin never hides the password fields, and there is no setting that makes it. Hiding would only ever be correct if nobody at all could use a password — and the anti-lockout guard below rewrites exactly that combination when your settings are loaded. The state that would justify hiding the form cannot be reached, so code to hide it would be code that never runs. A user who may not use a password sees the form, submits it, and is refused; the single sign-on button is on the same screen.
If the combination you save would leave nobody able to get in when the provider breaks — SSO only, admins blocked, no emergency account — the plugin turns password login for admins back on and tells you so: "These settings would have left nobody able to reach the control panel if the identity provider failed, so password login for admins was turned back on." It does not refuse the save, because these settings are also read while rendering the login page, and failing there would lock you out with the very guard meant to prevent it.
The guard checks your settings, not your accounts. It can see that the Emergency accounts list is not empty. It cannot see whether the accounts on it can actually sign in — and an account that does not exist, or has no local Craft password, is not a way back in.
date -u -d '+8 hours' +%s; while the window is open the settings screen counts the remaining minutes down.The non-obvious part of break glass is deliberate: if it is somehow enabled with no expiry at all — hand-edited project config, a legacy row, a value that did not survive a deploy — the switch is treated as off, not as open forever, and the screen says "Emergency password login was requested without an expiry time, so it stays off." An expiry further out than 24 hours — a timestamp accidentally written in milliseconds is the usual way to get one — is closed too, but with one difference worth knowing: that case is silent. The settings screen shows the switch as on and says nothing, because the message above is written only for the missing-expiry case. Password sign-in stays shut; if break glass looks enabled and is not letting anybody in, check the size of the timestamp. An emergency switch that never closes is just a permanent password door.
Two ways back in, in order:
php craft plugin/disable keyway-sso. A disabled plugin registers nothing, so Craft's password login returns to normal immediately. Your settings are kept, so you can fix the emergency list and re-enable it with php craft plugin/enable keyway-sso.It is the group and admin mapping — but only when a login actually writes to the account, which happens for a new account or for an existing one with Update accounts on every login switched on. Two combinations do the damage: sync mode Replace can remove the Craft group that granted control panel access, and Revoke admin when no rule matches clears the admin flag of anybody who signs in without matching an admin rule — including the account that configured the plugin.
Recovery is ordinary Craft: sign in with a password, from another administrator account if the first one lost its admin flag, and fix the mapping before signing in over single sign-on again. Test both on a throwaway account first. The details are on the group mapping page, and the reason codes are on the troubleshooting page.
SAML 2.0 and OpenID Connect sign-in for the Craft control panel: attribute and group mapping, just-in-time accounts, an admin password fallback with a guard that switches admin password login back on, with a warning, if your settings would otherwise leave nobody able to sign in, and a diagnostics screen that tells you why a login was refused. The plugin is in final testing and is on its way to the Craft Plugin Store.