# 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

- You need to be an administrator on the WordPress site and a Domain Admin in ID Everywhere.
- Each person who will sign in needs an ID Everywhere account in your company, with the **same email address** as their WordPress account (users must already be created in WordPress with the same email).
- Keep a WordPress administrator browser window signed in while you set this up, so you can't lock yourself out.

## 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.

<p class="callout warning">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.</p>

## 3. Configure the plugin

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

<table id="bkmrk-setting-value-login-" style="width: 100%; height: 863.782px;"><thead><tr style="height: 29.7969px;"><th style="width: 17.0462%; height: 29.7969px;">Setting</th><th style="width: 82.8348%; height: 29.7969px;">Value</th></tr></thead><tbody><tr style="height: 35.3906px;"><td style="width: 17.0462%; height: 35.3906px;">Login Type</td><td style="width: 82.8348%; height: 35.3906px;">**OpenID Connect button on login form** (recommended to start; see [Login Type](#bkmrk-login-type%3A-button-o))</td></tr><tr style="height: 29.7969px;"><td style="width: 17.0462%; height: 29.7969px;">Client ID</td><td style="width: 82.8348%; height: 29.7969px;">From step 2</td></tr><tr style="height: 29.7969px;"><td style="width: 17.0462%; height: 29.7969px;">Client Secret Key</td><td style="width: 82.8348%; height: 29.7969px;">From step 2</td></tr><tr style="height: 30.1094px;"><td style="width: 17.0462%; height: 30.1094px;">OpenID Scope</td><td style="width: 82.8348%; height: 30.1094px;">`openid email profile`</td></tr><tr style="height: 30.1094px;"><td style="width: 17.0462%; height: 30.1094px;">Login Endpoint URL</td><td style="width: 82.8348%; height: 30.1094px;">`https://app.ideverywhere.com/oauth2/authorize`</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Userinfo Endpoint URL</td><td style="width: 82.8348%; height: 46.5938px;">`https://app.ideverywhere.com/oauth2/userinfo`</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Token Validation Endpoint URL</td><td style="width: 82.8348%; height: 46.5938px;">`https://app.ideverywhere.com/oauth2/token`</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">End Session Endpoint URL</td><td style="width: 82.8348%; height: 46.5938px;">Leave blank</td></tr><tr style="height: 46.9062px;"><td style="width: 17.0462%; height: 46.9062px;">JWKS URI</td><td style="width: 82.8348%; height: 46.9062px;">`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)</td></tr><tr style="height: 32.8125px;"><td style="width: 17.0462%; height: 32.8125px;">Issuer</td><td style="width: 82.8348%; height: 32.8125px;">`https://app.ideverywhere.com`

</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">JWKS Cache TTL (seconds)</td><td style="width: 82.8348%; height: 46.5938px;">`3600`

</td></tr><tr style="height: 29.7969px;"><td style="width: 17.0462%; height: 29.7969px;">ACR values</td><td style="width: 82.8348%; height: 29.7969px;">Leave blank

</td></tr><tr style="height: 30.1094px;"><td style="width: 17.0462%; height: 30.1094px;">Identity Key</td><td style="width: 82.8348%; height: 30.1094px;">`email`

</td></tr><tr><td style="width: 17.0462%;">HTTP Request Timeout</td><td style="width: 82.8348%;">`5`

</td></tr><tr style="height: 29.7969px;"><td style="width: 17.0462%; height: 29.7969px;">Disable SSL Verify</td><td style="width: 82.8348%; height: 29.7969px;">Unticked</td></tr><tr style="height: 30.1094px;"><td style="width: 17.0462%; height: 30.1094px;">Nickname Key</td><td style="width: 82.8348%; height: 30.1094px;">`given_name`</td></tr><tr style="height: 30.1094px;"><td style="width: 17.0462%; height: 30.1094px;">Email Formatting</td><td style="width: 82.8348%; height: 30.1094px;">`{email}`</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Display Name Formatting</td><td style="width: 82.8348%; height: 46.5938px;">`{given_name} {family_name}`</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Identify with User Name</td><td style="width: 82.8348%; height: 46.5938px;">**Unchecked** </td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Enable Refresh Token</td><td style="width: 82.8348%; height: 46.5938px;">**Unchecked** (ID Everywhere doesn't issue refresh tokens)</td></tr><tr style="height: 29.7969px;"><td style="width: 17.0462%; height: 29.7969px;">Link Existing Users</td><td style="width: 82.8348%; height: 29.7969px;">**Checked**</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Create user if does not exist</td><td style="width: 82.8348%; height: 46.5938px;">**Unchecked** (see below)</td></tr><tr style="height: 46.5938px;"><td style="width: 17.0462%; height: 46.5938px;">Redirect Back to Origin Page</td><td style="width: 82.8348%; height: 46.5938px;">Suggest **Checked** but your choice. Checked will return them back to the wordpress login page if their access token has expired</td></tr></tbody></table>

Click **Save Changes**.

<p class="callout info">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.</p>

## 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.

<table id="bkmrk-situation-what-happe"><thead><tr><th>Situation</th><th>What happens</th></tr></thead><tbody><tr><td>WordPress account with the same email</td><td>Signed in to that account</td></tr><tr><td>No WordPress account with that email</td><td>Sign-in is refused, because **Create user if does not exist** is off.</td></tr><tr><td>Different email in WordPress and ID Everywhere</td><td>Treated as no account. Update the email in WordPress (**Users › Edit**) or in ID Everywhere so they match</td></tr><tr><td>Person disabled in ID Everywhere</td><td>Can no longer sign in with ID Everywhere. If they also know their WordPress password, remove or disable their WordPress account too</td></tr></tbody></table>

<p class="callout warning">**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.</p>

<p class="callout info">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.</p>

## Login Type: button or automatic

- **OpenID Connect button on login form:** the normal WordPress login page shows a **Login with ID Everywhere** button, and the username and password fields stay available. Start with this, so you can still sign in with a WordPress password while you test.
- **Auto Login - SSO:** visiting the login page sends people straight to ID Everywhere. Switch to this only after ID Everywhere sign-in is working for every administrator.

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.

<table id="bkmrk-error-cause-and-fix-"><thead><tr><th>Error</th><th>Cause and fix</th></tr></thead><tbody><tr><td>`invalid_client`</td><td>The Client ID or Client Secret in WordPress doesn't match. Paste them again; if unsure, regenerate the secret.</td></tr><tr><td>Redirect URI error on the ID Everywhere screen</td><td>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.</td></tr><tr><td>"User is not authorized for this application"</td><td>The person belongs to a different company from the one that owns the OIDC app.</td></tr><tr><td>WordPress says the user is invalid, or the user claim is missing</td><td>The Identity Key isn't `email`, or the `email` scope isn't ticked on the app in ID Everywhere.</td></tr><tr><td>Sign-in works but goes to the wrong account, or a new one</td><td>**Identify with User Name** is ticked. Untick it so accounts are matched by email.</td></tr><tr><td>"Failed user creation" or no account found</td><td>There's no WordPress account with that email. Create one in **Users › Add New** with the same email, then sign in again.</td></tr></tbody></table>

For other errors, see [Troubleshooting OIDC Connections](https://help.ideverywhere.com/books/applications-single-sign-on/page/troubleshooting-oidc-connections).

## Related articles

- [Connecting an Application Using OIDC](https://help.ideverywhere.com/books/applications-single-sign-on/page/connecting-an-application-using-oidc)
- [Choosing the Right OIDC Application Type](https://help.ideverywhere.com/books/applications-single-sign-on/page/choosing-the-right-oidc-application-type)
- [Understanding OIDC Settings and Security Terms](https://help.ideverywhere.com/books/applications-single-sign-on/page/understanding-oidc-settings-and-security-terms)

# 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

- You need to be an **Organization Admin** in Freshworks and a Domain Admin in ID Everywhere.
- Each agent who will sign in needs an ID Everywhere account in your company, with the **same email address** as their Freshdesk agent account (agents must already be added in Freshdesk with the same email).
- Which sign-in options you see depends on your Freshdesk plan. If OpenID Connect isn't offered, check your plan with Freshworks.
- Keep a Freshworks admin session open in another browser window while you set this up, so you can't lock yourself out.

<p class="callout info">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.</p>

## 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 &amp; 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.

<p class="callout warning">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.</p>

## 3. Finish the setup in Freshworks

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

<table id="bkmrk-freshworks-field-val"><thead><tr><th>Freshworks field</th><th>Value</th></tr></thead><tbody><tr><td>Client id</td><td>The **Client ID** from step 2. It starts with `ide_`.</td></tr><tr><td>Client secret</td><td>The **Client Secret** from step 2</td></tr><tr><td>Scopes</td><td>`openid,email,profile`</td></tr><tr><td>Logout URL</td><td>Leave blank</td></tr><tr><td>Authorization URL</td><td>`https://app.ideverywhere.com/oauth2/authorize`</td></tr><tr><td>Access token URL</td><td>`https://app.ideverywhere.com/oauth2/token`</td></tr><tr><td>Enhanced Security: Enable PKCE for SSO Authentication</td><td>**On**. ID Everywhere supports PKCE, and it adds protection against intercepted sign-in codes.</td></tr></tbody></table>

<p class="callout warning">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.</p>

Then open **Advanced Options**:

<table id="bkmrk-freshworks-field-val-1"><thead><tr><th>Freshworks field</th><th>Value</th></tr></thead><tbody><tr><td>Update profile every time a user logs in</td><td>**On**, so name and email changes in ID Everywhere carry over to Freshdesk</td></tr><tr><td>Button Label</td><td>`Sign in with ID Everywhere` (otherwise the button says "Sign in with SSO")</td></tr></tbody></table>

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

- Freshworks finds the agent by the **email address** from ID Everywhere and signs them in to that account.
- If someone changes their name or email in ID Everywhere, Freshworks updates their profile the next time they sign in.
- Freshworks doesn't store a password for SSO sign-ins. **Disabling someone in ID Everywhere stops them signing in to Freshdesk.**
- Only people in the company that owns the OIDC app can sign in. If you're an MSP setting this up for a client, create the app while you're working in that client's company.

## 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.

<table id="bkmrk-problem-cause-and-fi"><thead><tr><th>Problem</th><th>Cause and fix</th></tr></thead><tbody><tr><td>Redirect URI error on the ID Everywhere screen</td><td>The Redirect URL in ID Everywhere doesn't exactly match the one Freshworks shows. Copy it again from Freshworks.</td></tr><tr><td>`invalid_client` (Audit Log: `oidc.token.denied`)</td><td>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.</td></tr><tr><td>"User is not authorized for this application"</td><td>The person belongs to a different company from the one that owns the OIDC app.</td></tr><tr><td>Signed in to ID Everywhere, but Freshdesk can't find the agent</td><td>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.</td></tr><tr><td>Name is missing in Freshdesk</td><td>The `profile` scope is missing. Check that **Scopes** in Freshworks includes `profile` and that `profile` is ticked on the app in ID Everywhere.</td></tr></tbody></table>

For other errors, see [Troubleshooting OIDC Connections](https://help.ideverywhere.com/books/applications-single-sign-on/page/troubleshooting-oidc-connections).

## Related articles

- [Connecting an Application Using OIDC](https://help.ideverywhere.com/books/applications-single-sign-on/page/connecting-an-application-using-oidc)
- [Connecting WordPress with OpenID Connect](https://help.ideverywhere.com/books/applications-single-sign-on/page/connecting-wordpress-with-openid-connect)
- [Troubleshooting OIDC Connections](https://help.ideverywhere.com/books/applications-single-sign-on/page/troubleshooting-oidc-connections)