sf
parameter (starting at 1) Table of Contents
SalesForce Auth Plugin
Compatible with DokuWiki
Hrun
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to oauth
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
External requirements: This plugin requires the following additional components that must be installed separately:
- SalesForce Account with administrator access
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Change Log
- Version upped (2016-02-03 18:42)
- Merge pull request #1 from splitbrain-forks/php7-signature (2016-02-03 12:56)
- Adjust method signatures to match parent (2016-02-03 12:44)
- log login via the loglog plugin (2015-05-04 11:58)
- hide normal login by default (2015-05-04 10:51)
- redirect to original page after login (2015-02-23 11:33)
- fixed direct login via salesforce tab (2015-02-19 13:10)
- add instance and default group to users (2015-02-19 12:55)
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.
- Login
- Click on your name in the top toolbar
- Click on
Setup
- Click on
Create
underApp Setup
in the left hand navigation - Click on
Apps
- Under “Connected Apps” click the
New
button - 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)
- Take note of the
Consumer Key
andConsumer 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.
- Login
- Click on your name in the top toolbar
- Click on
Setup
- Click on
Customize
underApp Setup
in the left hand navigation - Click on
Users
- Click on
Fields
- Click on
new
in theUser Custom Fields
section (page bottom)- Step 1:
- Picklist (Multi-Select)
- 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
- Step 3:
- keep defaults
- 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:
- Click on your name in the top toolbar
- Click on
Setup
- Click on App Setup → Create → Tabs
- Create a new web tab
- 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.