This guide shows you how to configure the WP OAuth Server (Business Edition) plugin in WordPress and connect it with Webcastcloud to enable Single Sign-On (SSO) for your video content.
Step 1: Configure WP OAuth Server in WordPress
-
Install and activate the WP OAuth Server (Business Edition) plugin.
-
Go to WP OAuth Server > Clients and click Add New:
-
Client Name: Webcastcloud
-
Redirect URI:
https://yourwebcastcloudsite.com/oauth/sso -
Client Scope: openid profile
- Grant Type: Tick Authorization Code, Client Credentials
-
-
Save Client
-
Copy the ID (found top of the client edit page), Client ID and Client Secret.
- Browse to WP-OAuth Plugin > Settings >General Settings >Enable OAuth Server >Save
- Click Advanced Configuration tab, Enable Open ID Connect >Save
Step 2: Add User Profile Fields to /oauth/me
To include user profile information like first name, last name, and member types in the /oauth/me response, add the following code to your WordPress theme’s functions.php file
- Browse to Appearance >Theme File Editor >Select functions.php
Or from WP File Manager, you can navigate to this path: /wp-content/themes/your-active-theme-name/functions.php
- Select Enable Editing
-
Add the following code to the bottom of your functions.php file
Note: This file may be updated when moving to a new theme. So you can also create a new plugin to avoid writing over this in the future.
/**
*Wp-Auth - Add First Name and Last Name to the /oauth/me response
*/
add_filter( 'wo_me_resource_return', 'wo_extend_me_with_names', 99 );
function wo_extend_me_with_names( $data ) {
$first_name = get_user_meta( $data['ID'], 'first_name', true );
$last_name = get_user_meta( $data['ID'], 'last_name', true );
$contact_tags = get_user_meta( $data['ID'], 'contact_tags', true );
$data['first_name'] = $first_name;
$data['last_name'] = $last_name;
$data['name'] = trim($first_name . ' ' . $last_name);
if ( is_array( $contact_tags ) ) {
$data['contact_tags'] = implode( ',', $contact_tags );
} else {
$data['contact_tags'] = is_string( $contact_tags ) ? $contact_tags : '';
}
return $data;
}
To return additional fields like member type or member groups, please contact Webcastcloud Support. As this will be dependant on your wordpress setup and other plugin's.
Step 3: Set Up OAuth in Webcastcloud
-
Log into your Webcastcloud Admin portal.
-
Go to Settings > Integrations > Platforms >OAuth2 and enable OAuth2.
-
Click Edit OAuth and fill in the details:
-
Tenant ID: Add the ID that was at the top the client application in WP-OAuth Step1.
-
Authorize URL:
https://yourdomain.com/oauth/authorize -
Token URL:
https://yourdomain.com/oauth/token -
Client ID: (from WordPress)
-
Client Secret: (from WordPress)
-
Scope:
openid profile -
User Info URL:
https://yourdomain.com/oauth/me -
Logout URL:
https://yourdomain.com/logout
Use full URLs. Replace
yourdomain.comwith your actual WordPress site domain.
Step 4: Map User Fields in Webcastcloud
Under OAuth User Mapping, configure the following:
- Member Response Mapping >Add
- Property Name: This will be the name of the contact field in Wordpress
- Dynamic Content: Turn On
- Property Value: Select the field this will be mapped to in Webcastcloud
Repeat the above step, for each of the fields below:
| WP-OAuth Field | Webcastcloud Field |
|---|---|
| user_email | |
| first_name | First Name |
| last_name | Last Name |
| ID | IntegrationUid |
| user_login | User Name |
Step 5: Test the Integration
-
Open your Webcastcloud Content Library.
-
Click Log In.
-
You will be redirected to your WordPress login screen (or custom login page, if configured).
-
Upon logging in, you’ll return to Webcastcloud as an authenticated user.