Special thanks to @dashohoxha for his help!!
Continuing the discussion from OAuth2 Basic Support:
I will use this thread to document my steps and progress in integrating Discourse and Drupal via OAuth2.
At present, the status of my implementation is WORKING.
Installation on Discourse:
For installation on Discourse, do the following:
Configure OAuth2 plugin:
- You should see an “OAuth2” section in “Login” in Settings when logged in as an administrative user.
- Enable “Custom OAuth2 is enabled”
- Set client ID as “discourse”.
- Create a client secret that is a random series of letters and numbers. You can use
apg -a 0 -m 20to generate one.
oauth2 authorize url:
https://DRUPAL/oauth2/authorizewhere DRUPAL = your Drupal site’s base URL
oauth2 token url:
oauth2 user json url:
oauth2 json user id path:
oauth2 json username:
- oauth2 json name path:[ You can leave this blank]
oauth2 json email path:
- oauth2 email verified: [Check this on]
When you hit ‘login’, you should now see a ‘login with OAuth2’ option.
Installation on Drupal
- Install the following plugins:
- Add client at
- Call the client
- Enter the same client secret as above
- Set Redirect URIs as
http://DISCOURSE/auth/oauth2_basic/callbackwhere DISCOURSE = your discourse forum’s base URL
Status and Known Issues:
If you follow the steps above, you should see a “with OAuth2” badge on the login screen. Clicking on it should redirect you to your Drupal site for login that asks “Authorize discourse to use your account?” Clicking “Yes” results in either association to an existing account with the same email or creation of a new account with that email.
- Must be authorized with each login.
- Does not honour ‘groups’ / ‘roles’
tarek : )