Setting up Salesforce auth using OAuth2 basic support plugin


(Sam Saffron) #1

Using the OAuth2 basic support plugin you can set up Salesforce authentication.

To do so, create a connected OAuth2 app on Salesforce:

  • Create -> Apps -> New connected app

  • Ensure you allow access to “access basic information”

  • Set the “Callback URL” to https://YOURFORUM.COM/auth/oauth2_basic/callback : Note you must be running your Discourse forum with HTTPS.

  • Take note of client id and secret

On Discourse side, use the following site settings:

  • oauth2 enabled
  • oauth2 client id and secret, per previous section
  • oauth2 authorize url: https://login.salesforce.com/services/oauth2/authorize
  • oauth2 token url: https://login.salesforce.com/services/oauth2/token
  • oauth2 user json url: :id
  • oauth2 json user id path: id
  • oauth2 json username path: nick_name
  • oauth2 json name path: display_name
  • oauth2 json email path: email
  • oauth2 email verified: true
  • oauth2 authorize options: scope, display, immediate, state

If you are having trouble be sure to enable oauth2 debug auth and check your /logs