WP OAuth Server is designed and tested with Rocket Chat and provides OAuth Single Sign-On. Setup is simple and only take a few minutes.
NOTE: Rocket Chat OAuth will not work with local installs of WordPress. The WordPress website with WP OAuth Server installed MUST be public.
Setting up WP OAuth Server
Create a new client by visiting “OAuth Server” in the main admin menu in WordPress.
- Ensure “Authorization Code” is checked
- Leave the Redirect URI field empty
- Click “Create Client”
- Take note of the Client ID and Client Secret. Keep this window open for easier access.
- Visit Rocket Chat to configure the OAuth Service.
Setting up Rocket Chat
Open Rocket Chat and log into the system as an administrator or a user with administrator privileges.
Go to Administration -> OAuth -> Add Custom OAuth -> Enter Your OAuth Server Name (any name)
WP OAuth Server is set up with Provider discovery so most of the endpoints will auto-populate but you should double check them just to be sure. Follow the configuration settings below.
- Enable: True
- URL: The URL where WP OAuth Server is installed. (no trailing slash /)
- Token Path: /oauth/token/
- Token Sent By: Payload
- Identify Token Sent Via: Same As
- Identity Path: /oauth/me/
- Authorize Path: /oauth/authorize/
- Scope: openid
- ID: The client ID from the WP OAuth Server window left open.
- Secret: The client Secret from the WP OAuth Server window left open.
- Login Style: Popup (your preference)
- Username Field: user_login
- Merge Users: True
Once the settings have been saved, Rocket Chat will now work with your WordPress users using OAuth Single Sign-On. Rocket Chat’s login window will now have a login button for Single Sign-On similar to the image below.