Table of Contents

SalesForce Auth Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" unknown
  • 2016-06-26 "Elenor Of Tsort" unknown
  • 2015-08-10 "Detritus" unknown
  • 2014-09-29 "Hrun" yes

plugin Allow SalesForce auth besides auth plain.

Last updated on
2016-02-03
Provides
Auth, Action
Repository
Source

Similar to oauth

Tagged with authentication, salesforce

This plugin allows users to login with their Salesforce account in addition to the default plain authentication backend. Up to three Salesforce instances can be used.

Installation

A CosmoCode Plugin

:!: External requirements: This plugin requires the following additional components that must be installed separately:

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually. Follow the setup instructions.

Change Log

Setup

For the setup of this plugin you have to follow the steps below in the given order.

At SalesForce

Remote Access

You need to register an App with oAuth access in Salesforce.

  1. Login
  2. Click on your name in the top toolbar
  3. Click on Setup
  4. Click on Create under App Setup in the left hand navigation
  5. Click on Apps
  6. Under “Connected Apps” click the New button
  7. Fill Form
    • Connected App Name: DokuWiki
    • API Name: DokuWiki
    • Contact Email: your email address
    • API → Enable OAuth Settings
      • Callback URL - see DokuWiki's config manager. Should be something like http://example.com/dokuwiki/doku.php?do=login&u=sf&p=sf&sf=1 1)
      • Don't enable digital signatures!
      • Select the following oAuth scopes:
        • Access and manage your data (api)
        • Access your basic information (id, profile, email, address, phone)
        • Perform requests on your behalf at any time (refresh_token, offline_access)
  8. Take note of the Consumer Key and Consumer Secret strings shown in the Overview after saving. These will have to be configured in DokuWiki later.

Add custom profile Field for Groups

To be able to assign DokuWiki-specific groups to user accounts, you need a custom field.

  1. Login
  2. Click on your name in the top toolbar
  3. Click on Setup
  4. Click on Customize under App Setup in the left hand navigation
  5. Click on Users
  6. Click on Fields
  7. Click on new in the User Custom Fields section (page bottom)
    1. Step 1:
      • Picklist (Multi-Select)
    2. Step 2:
      • Field Label: DokuWiki Groups
      • Values: enter the groups you want to assign to users
      • Visible Lines: whatever you like
      • Field Name: DokuWiki_Groups
    3. Step 3:
      • keep defaults
    4. Step 4:
      • keep defaults
      • Save

You now can add Groups to your users that will be picked up by DokuWiki. DokuWiki will add the default group (configured in Dokuwiki) and the instance name (salesforce1, salesforce2, salesforce3) to theses groups automatically.

Optional: Use the wiki in a web tab

This allows you to embed DokuWiki in a Tab of your SalesforceInstance and have users automatically authenticated in it. This requires that your wiki is available under https.

To create the web tab:

  1. Click on your name in the top toolbar
  2. Click on Setup
  3. Click on App Setup → Create → Tabs
  4. Create a new web tab
    1. fill out the forms important field is: Button or Link URL
      • You need to fill in what you configured for the callback URL above, but add &sessionId={!API_Session_ID}&instance={!API_Enterprise_Server_URL_240}&user={!User_ID} to it. Eg. http://example.com/dokuwiki/doku.php?do=login&u=sf&p=sf&sf=1&sessionId={!API_Session_ID}&instance={!API_Enterprise_Server_URL_240}&user={!User_ID}

URL for Link URL

In DokuWiki

In DokuWiki you can configure the plugin via the Configuration Manager Plugin. Fill in the Consumer Key and Consumer Secret you got at the end of the first Salesforce step.

Be sure to set the authtype settting to sfauth.

Owners domain

As username the plug-in will use the e-mail address provided by sales force. In some cases you may want to strip away the host part from the e-mail address to have nice names. To provide a unique username this feature is limited to one host. Just set the owners domain option to your domain. I.e.: example.com.

Multiple Salesforce Instances

This plugin allows you to configure up to 3 Salesforce instances users may log in from. You have to repeat the Salesforce Setup steps above in each instance.

It is possible that one user is configured in multiple of the instances. She will be identified by her contact email (not her salesforce login). However the groups will always be pulled from the instance the user logged in from.

You can use the groups salesforce1, salesforce2 and salesforce3 groups to differentiate between users from different instances.

1)
Each Salesforce Instance you configure will have a different sf parameter (starting at 1)