r/WordpressPlugins • • 3d ago

Freemium [FREEMIUM] Faable Auth: replace wp-login.php with OpenID Connect sign-in, WordPress roles synced from your identity provider (dev here)

Hi, I'm Marc, one of the people behind Faable. Our WordPress plugin, Faable Auth, was just approved in the WordPress.org directory, so I'm sharing it here.

What it does: the site becomes an OpenID Connect client of a Faable Auth tenant, and wp-login.php shows a "Log in with Faable" button instead of the password form.

  • Authorization code flow with PKCE. Once the site is connected, password logins, password resets, registration, XML-RPC auth and Application Passwords are turned off.
  • The WordPress role is re-read from the user's Faable Auth roles on every login. Remove the role and they lose access at their next login. If the roles can't be read, the login is refused rather than guessed.
  • Existing WordPress users are linked by email, but only if the email is verified.
  • Headless front-ends can call the REST API with machine-to-machine (client_credentials) tokens instead of Application Passwords.
  • Optional federated logout.
  • Emergency access: a break-glass constant in wp-config.php and one-time login links from WP-CLI (wp faable-auth login-link <user>).

To be upfront about the "freemium" tag: the plugin itself is free and GPL. It needs a Faable Auth account, which has a free plan, and there are paid plans. WordPress 6.4+ and PHP 8.1+, no Multisite yet.

Plugin: https://wordpress.org/plugins/faable-auth/ Setup guide: https://faable.com/docs/auth/integrations/wordpress Why it works this way (role re-sync, verified-email linking, emergency access): https://dev.to/boyander/replacing-wp-loginphp-with-openid-connect-six-things-that-are-easy-to-get-wrong-54d5

Feedback welcome, especially from anyone who has built or audited a WordPress SSO plugin.

0 Upvotes

4 comments sorted by

1

u/PeepSoWP 2d ago

The next-login role check is a useful limit to spell out. For a membership site, I'd also test removing an IdP role while the member already has WordPress open, then requesting the protected page again in that same session. What is the maximum time they can retain access without logging in again? That gives site owners a concrete revocation window to plan around, rather than assuming that disabling the IdP account immediately ends every existing WordPress session.

1

u/boyander 2d ago

Good question, and the honest number today is 48 hours.

The plugin signs the user in with a normal WordPress auth cookie, without "remember me", so WordPress's default applies: the session token is valid for 48 hours on the server, even though the browser drops the cookie when it closes. Roles are only read at login. On the next login, if the user no longer has a mapped role, the plugin removes their WordPress role and destroys all their sessions. Until then, an open session keeps whatever role it had.

So removing a role in the IdP doesn't end an existing WordPress session. What you can do today:

  • shorten the window with the auth_cookie_expiration filter (e.g. 1–2 hours for a membership site; users just bounce through the IdP more often), or
  • when you revoke someone, also use "Log Out Everywhere" on their WordPress profile.

A periodic role re-check during the session (so the window is minutes, not the cookie lifetime) is the next thing I'd like to add. Thanks for raising it, it should be in the docs.

2

u/PeepSoWP 1d ago

Thanks, that makes the current limit clear. One detail for the documentation: changing auth_cookie_expiration affects cookies issued afterwards; it doesn't shorten the expiry already stored in an existing cookie. WordPress sets that expiry when it issues the cookie. Pairing IdP revocation with WordPress session invalidation therefore matters for people already signed in. A useful regression case would keep one session open from before the filter change, then verify that revoking it prevents its next protected request.

1

u/boyander 1d ago

You're right, and that's the gap: a shorter cookie lifetime only helps sessions issued after the change, so it can't revoke anyone who is already signed in.

So we fixed it on the session side instead. Version 1.5.0 (out today on wordpress.org) reads the user's roles again during the session, every 15 minutes by default, on their next request. If the IdP no longer gives them a role for the site, they lose the WordPress role and all their sessions are destroyed, so the protected page they asked for sends them to the login. A changed role applies the same way, without logging in again. It works on sessions that were already open before the update too: a session that has never been re-checked is checked on its first request.

Your regression case is the one we test: one session open, the role removed in Faable Auth, then the next protected request in that same session. On a test site with the interval set to 1 minute it was bounced to the login 42 seconds after the removal. If the IdP can't be reached, nobody is signed out and it retries a minute later. The interval is configurable (FAABLE_AUTH_ROLE_RECHECK_MINUTES), and revoking a user's sessions in Faable Auth already ends them immediately through back-channel logout.

Thanks for pushing on this, it's in the docs now: https://faable.com/docs/auth/integrations/wordpress#roles