OIDC Tutorials

Connecting WordPress with OpenID Connect

Let people sign in to a WordPress website with their ID Everywhere account, including two-factor authentication. This guide uses the free OpenID Connect Generic Client plugin and links ID Everywhere to the WordPress accounts you already have, by email address.

Before you start

1. Install the plugin

  1. In WordPress, go to Plugins › Add New Plugin.
  2. Search for OpenID Connect Generic Client, then click Install Now and Activate.
  3. Go to Settings › OpenID Connect Client. Scroll to the bottom and copy the Redirect URI. It looks like this:
    https://yourwebsite.com/wp-admin/admin-ajax.php?action=openid-connect-authorize

2. Register WordPress in ID Everywhere

  1. In ID Everywhere, go to Sign-In › OIDC Apps and click + Add OIDC Application.
  2. Application Name: your website's name, for example "Company Website". People see it on the sign-in screen and in their sign-in emails.
  3. Client Type: Confidential. WordPress runs on a server, so it can keep a secret.
  4. Authorized Redirect / Callback URLs: paste the Redirect URI from step 1, exactly as WordPress shows it, including the ?action=openid-connect-authorize part.
  5. Scopes: leave openid, profile and email ticked. WordPress needs the email address to find each person's account.
  6. Click Create Application, then copy the Client ID and the Client Secret. The secret is shown only once.

Paste the client secret straight into WordPress or a password manager. Don't email it. If it's lost, or you're not sure it was pasted exactly, click Regenerate Client Secret and use the new one.

3. Configure the plugin

Back in WordPress, on Settings › OpenID Connect Client, enter these settings:

Setting Value
Login Type OpenID Connect button on login form (recommended to start; see Login Type)
Client ID From step 2
Client Secret Key From step 2
OpenID Scope openid email profile
Login Endpoint URL https://app.ideverywhere.com/oauth2/authorize
Userinfo Endpoint URL https://app.ideverywhere.com/oauth2/userinfo
Token Validation Endpoint URL https://app.ideverywhere.com/oauth2/token
End Session Endpoint URL Leave blank
JWKS URI https://app.ideverywhere.com/.well-known/jwks.json (lets WordPress check that each sign-in really came from ID Everywhere; shown in newer versions of the plugin)
Issuer

https://app.ideverywhere.com

JWKS Cache TTL (seconds)

3600

ACR values

Leave blank

Identity Key

email

HTTP Request Timeout

5

Disable SSL Verify Unticked
Nickname Key given_name
Email Formatting {email}
Display Name Formatting {given_name} {family_name}
Identify with User Name Unchecked 
Enable Refresh Token Unchecked (ID Everywhere doesn't issue refresh tokens)
Link Existing Users Checked
Create user if does not exist Unchecked (see below)
Redirect Back to Origin Page Suggest Checked but your choice. Checked will return them back to the wordpress login page if their access token has expired

Click Save Changes.

Don't use preferred_username for the Identity Key or Nickname Key. Some providers send it, but ID Everywhere doesn't, and WordPress will refuse the sign-in.

How WordPress matches people to their accounts

With the settings above, WordPress uses the email address from ID Everywhere to find the right account:

  1. The first time someone signs in with ID Everywhere, WordPress looks for an existing account with the same email address.
  2. If it finds one, it signs them in to that account and links the two. They keep their WordPress role, posts and settings, and their WordPress password still works too.
  3. After that, they're signed in to the linked account every time.
Situation What happens
WordPress account with the same email Signed in to that account
No WordPress account with that email Sign-in is refused, because Create user if does not exist is off.
Different email in WordPress and ID Everywhere Treated as no account. Update the email in WordPress (Users › Edit) or in ID Everywhere so they match
Person disabled in ID Everywhere Can no longer sign in with ID Everywhere. If they also know their WordPress password, remove or disable their WordPress account too

Leave "Create user if does not exist" off unless you want everyone in your company to get a WordPress account automatically. If you turn it on, new accounts get WordPress's default role (Settings › General › New User Default Role (default is Subscriber)). Make sure that's Subscriber, never Administrator.

Only people in the company that owns the OIDC app can sign in to it. If you're an MSP setting this up for a client, create the app while you're working in that client's company.

Login Type: button or automatic

To put the sign-in button somewhere else, such as a members page, add the shortcode [openid_connect_generic_login_button].

4. Test it

  1. Open a private browser window and go to your WordPress login page, for example https://yourwebsite.com/wp-login.php.
  2. Click Login with OpenID Connect.
  3. Sign in with your ID Everywhere email, password and two-factor code. If you're already signed in to ID Everywhere, this step is skipped.
  4. You land in WordPress, signed in to your existing account.

The person signing in gets a New App Sign-In email naming your website. They get one the first time they use it during each ID Everywhere session.

Troubleshooting

Turn on Enable Logging in the plugin settings to see each step. In ID Everywhere, check the Audit Log for oidc. events at the same time.

Error Cause and fix
invalid_client The Client ID or Client Secret in WordPress doesn't match. Paste them again; if unsure, regenerate the secret.
Redirect URI error on the ID Everywhere screen The Redirect URI registered in ID Everywhere doesn't exactly match the one in the plugin. Copy it again from the bottom of the plugin's settings page.
"User is not authorized for this application" The person belongs to a different company from the one that owns the OIDC app.
WordPress says the user is invalid, or the user claim is missing The Identity Key isn't email, or the email scope isn't ticked on the app in ID Everywhere.
Sign-in works but goes to the wrong account, or a new one Identify with User Name is ticked. Untick it so accounts are matched by email.
"Failed user creation" or no account found There's no WordPress account with that email. Create one in Users › Add New with the same email, then sign in again.

For other errors, see Troubleshooting OIDC Connections.

Connecting Freshdesk with OpenID Connect

Let your support team sign in to Freshdesk with their ID Everywhere account, including two-factor authentication. Freshdesk uses Freshworks SSO, which connects to ID Everywhere with OpenID Connect and matches people to their Freshdesk accounts by email address.

Before you start

This guide sets up sign-in for agents, your own staff. Freshdesk contacts (your customers) usually don't have ID Everywhere accounts in your company, so leave their sign-in as it is unless your help portal is only for your own people.

1. Start the SSO setup in Freshworks

  1. Sign in to your Freshworks organization, for example https://yourcompany.myfreshworks.com.
  2. Click the Security icon in the sidebar, then go to Agents & Employees › Default Login Methods.
  3. Turn on SSO Login and choose OpenID Connect (OIDC).
  4. Copy the Redirect URL Freshworks shows. You'll need it exactly in the next step. Leave this page open.

2. Register Freshdesk in ID Everywhere

  1. In ID Everywhere, go to Sign-In › OIDC Apps and click + Add OIDC Application.
  2. Application Name: Freshdesk. People see it on the sign-in screen and in their sign-in emails.
  3. Client Type: Confidential.
  4. Authorized Redirect / Callback URLs: paste the Redirect URL from Freshworks, exactly as shown.
  5. Scopes: leave openid, profile and email ticked.
  6. Click Create Application, then copy the Client ID and the Client Secret. The secret is shown only once.

Paste the client secret straight into Freshworks or a password manager. Don't email it. If it's lost, click Regenerate Client Secret and use the new one.

3. Finish the setup in Freshworks

Back on the Freshworks SSO page, fill in the fields in the order they appear:

Freshworks field Value
Client id The Client ID from step 2. It starts with ide_.
Client secret The Client Secret from step 2
Scopes openid,email,profile
Logout URL Leave blank
Authorization URL https://app.ideverywhere.com/oauth2/authorize
Access token URL https://app.ideverywhere.com/oauth2/token
Enhanced Security: Enable PKCE for SSO Authentication On. ID Everywhere supports PKCE, and it adds protection against intercepted sign-in codes.

Browsers sometimes autofill your email address into Client id. Make sure it contains the Client ID from ID Everywhere (starting with ide_), not an email address.

Then open Advanced Options:

Freshworks field Value
Update profile every time a user logs in On, so name and email changes in ID Everywhere carry over to Freshdesk
Button Label Sign in with ID Everywhere (otherwise the button says "Sign in with SSO")

Freshworks reads each person's email address and name from ID Everywhere automatically. No claim mapping is needed.

Click Configure SSO (or Save).

How Freshdesk matches agents to their accounts

4. Test before turning off other sign-in methods

  1. Leave Freshworks' other login method (for example, email and password) turned on for now.
  2. Open a private browser window and go to your Freshdesk sign-in page.
  3. Click Sign in with ID Everywhere, then sign in with your ID Everywhere email, password and two-factor code.
  4. You land in Freshdesk, signed in to your own agent account.
  5. Once every admin has signed in this way successfully, you can turn off the other login methods in Default Login Methods, so agents always sign in through ID Everywhere.

The agent gets a New App Sign-In email naming Freshdesk. They get one the first time they use it during each ID Everywhere session.

Troubleshooting

Check the ID Everywhere Audit Log for oidc. events right after a failed attempt.

Problem Cause and fix
Redirect URI error on the ID Everywhere screen The Redirect URL in ID Everywhere doesn't exactly match the one Freshworks shows. Copy it again from Freshworks.
invalid_client (Audit Log: oidc.token.denied) The Client id or Client secret in Freshworks doesn't match. Check that Client id wasn't autofilled with an email address, paste both again, and if unsure, regenerate the secret.
"User is not authorized for this application" The person belongs to a different company from the one that owns the OIDC app.
Signed in to ID Everywhere, but Freshdesk can't find the agent The agent's email in Freshdesk doesn't match their ID Everywhere email, or they aren't an agent yet. Fix the email or add them as an agent.
Name is missing in Freshdesk The profile scope is missing. Check that Scopes in Freshworks includes profile and that profile is ticked on the app in ID Everywhere.

For other errors, see Troubleshooting OIDC Connections.