πŸ” How to Integrate Authentik with WordPress Using the miniOrange OAuth Plugin

Authentik is a powerful identity provider β€” but when you use it with WordPress via the miniOrange OAuth/OpenID Connect (OIDC) plugin, you can hit a couple of common issues:

  • Missing Email Verification
  • Username not received
  • Authentik sending "email_verified": false

This guide walks through the exact steps to make Authentik talk cleanly to WordPress with the miniOrange plugin.


🚦 Background: What WordPress & miniOrange Expect

The WordPress OAuth/OIDC workflow expects certain claims in the ID token:

ClaimRequired?Expected Format
emailβœ”true email
email_verifiedβœ”boolean (not string)
preferred_username or usernameβœ”string

Authentik defaults email_verified to false for safety, because it doesn’t assume verification is real unless you explicitly confirm it.

Many apps (including WordPress plugins) consider an unverified email to be untrustworthy β€” and won’t create or authorize users if the claim is false.


βœ… Step 1 β€” Create a Custom Scope Mapping for Email

Authentik’s default email scope sets:

"email_verified": False

We need to flip that.

In Authentik:

πŸ”Ή Go to:

Customizations β†’ Property Mappings β†’ Create

πŸ“Œ Choose Scope Mapping

Fill the form:

Save.

This mapping ensures the email_verified claim is always sent back as a real boolean, which WordPress expects.


βœ… Step 2 β€” Update the WordPress OIDC Provider

Now that you have a custom email mapping:

  1. Go to:
Applications β†’ Providers β†’ (your WordPress provider)
  1. Click Edit
  2. Expand Advanced Protocol Settings
  3. In Scopes, update like so:
  1. Update the provider

βœ… Step 3 β€” Verify Your Claims

The ID token now needs to contain:

{
  "email": "user@example.com",
  "email_verified": true,
  "preferred_username": "user@example.com"
}

If you’re unsure what is being returned:

  • Log into Authentik Admin
  • Navigate to the Events view
  • Look for the token issuance event
  • Decode the JWT (e.g. via jwt.io)

You can also enable token preview in the provider screens.


βœ… Step 4 β€” Ensure WordPress Gets a Username

If WordPress reports:

Username not received. Check your Attribute Mapping configuration.

Then make sure the profile scope is included in the provider:

βœ” openid
βœ” profile
βœ” your new email mapping

The profile scope (the default mapping) ensures you will get:

  • preferred_username
  • name
  • other user profile claims

miniOrange needs username-like claims to create accounts.


πŸ’‘ WordPress miniOrange Plugin SETTINGS

In the miniOrange plugin settings in WordPress:

OIDC / OAuth Configuration:

  • Client ID and Client Secret: supplied from Authentik provider
  • Redirect URL: must match Authentik’s configured redirect
  • Scopes: openid profile email
  • User Attribute Mapping:
    • Username β†’ preferred_username
    • Email β†’ email

This mapping works with the claims we’re sending.


βœ… Test the Flow

  1. Open a new private browser window
  2. Start the login from WordPress
  3. You should be redirected to Authentik
  4. After login, WordPress should:
    • Accept the callback
    • Create the user if new
    • Log in the user automatically

🎯 Why the email_verified Change Matters

As documented in the Authentik 2025.10 release, the default mapping now deliberately sends:

"email_verified": false

That’s a security decision β€” but many apps block account creation if email isn’t verified.

By creating a custom scope mapping that returns true, you signal to WordPress that this email can be trusted.

If you want a conditional version (only true if Authentik truly verified the email via a flow), you can expand the mapping:

return {
    "email": request.user.email,
    "email_verified": bool(request.user.attributes.get("email_verified", False))
}

🧠 Summary Checklist

β˜‘ Create Scope Mapping for email with email_verified: True
β˜‘ Replace the default email mapping in your provider
β˜‘ Ensure openid and profile scopes are selected
β˜‘ Map preferred_username β†’ Username in miniOrange
β˜‘ Test login in private window


πŸ“Œ References


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *