Rocket.Chat lets you enable sign-in with WordPress accounts. With this option, you can centralize user authentication, control access to APIs or data from your WordPress site, and customize how OAuth behaves.
Prerequisites
Before setting up WordPress OAuth, make sure you have:
An OAuth Server plugin installed on your site, or a custom OAuth server implementation.
The Client ID and Client Secret generated by your OAuth server plugin.
Configure WordPress OAuth
Once your OAuth plugin is ready, configure WordPress OAuth in Rocket.Chat:
In your Rocket.Chat workspace, go to Administration > Workspace > Settings > OAuth and expand the WordPress section.
Toggle WordPress Login to on.
Enter the following values:
WordPress URL: Enter the URL of your WordPress site.
WordPress Id: Enter the Client ID generated by your WordPress OAuth plugin.
WordPress Secret: Enter the Client Secret generated by your WordPress OAuth plugin.
Server Type: Select one of the following:
WordPress.com: Use this if you are logging in with a WordPress.com account and an OAuth server plugin.
WP OAuth Server Plugin: Use this if you are using the WP OAuth Server plugin (for example, miniOrange).
Custom: Use this if you are implementing a custom OAuth server.
If you select Custom, also configure:
Identity Path: Enter the path used to retrieve user identity information.
Token Path: Enter the path Rocket.Chat will call to get the access token.
Authorize Path: Enter the path Rocket.Chat will use to request authorization.
Identity Token Sent Via: Choose how the token is passed (header or request parameters).
Scope: Define the user information that Rocket.Chat can access (must match your plugin settings).
WordPress Callback URL: Copy this value from Rocket.Chat and paste it into your WordPress OAuth server plugin settings.
Click Save changes.
After saving, a Sign in with WordPress button will appear on your workspace login page. Users can now sign in with their WordPress accounts.
Troubleshooting WordPress OAuth
If you encounter issues with WordPress OAuth, you can enable detailed logging in Rocket.Chat to diagnose the problem:
Go to Administration > Logs > Log Level > View Logs.
Set the log level to Level 2 Logging.
While monitoring the logs, open the login screen in an incognito browser window and attempt a login.
Watch the logs, the OAuth response is displayed in real time, which can help you identify the error.
Common error
If you see the error "The redirect URI provided is missing or does not match"
this means the Callback URL in your WordPress plugin does not match the WordPress Callback URL in Rocket.Chat.
For more troubleshooting details, visit the Rocket.Chat forum.