DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sfauth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:sfauth [2014-12-18 13:18] grosseplugin:sfauth [2024-01-08 15:51] (current) Aleksandr
Line 1: Line 1:
-====== sfauth Plugin ======+====== SalesForce Auth Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: Allow SalesForce auth besides auth plain.+description: Allow SalesForce auth besides auth plain
 author     : Dominik Eckelmann, Andreas Gohr author     : Dominik Eckelmann, Andreas Gohr
 email      : dokuwiki@cosmocode.de email      : dokuwiki@cosmocode.de
 type       : action, auth type       : action, auth
-lastupdate : 2013-02-11 +lastupdate : 2016-02-03 
-compatible : angua+compatible : Hrun
 depends    :  depends    : 
 conflicts  conflicts 
-similar    : +similar    : oauth
 tags       : authentication, salesforce tags       : authentication, salesforce
  
-downloadurl: http://github.com/cosmocode/dokuwiki-plugin-sfauth/zipball/master +downloadurl: https://github.com/cosmocode/dokuwiki-plugin-sfauth/zipball/master 
-bugtracker : http://github.com/cosmocode/dokuwiki-plugin-sfauth/issues +bugtracker : https://github.com/cosmocode/dokuwiki-plugin-sfauth/issues 
-sourcerepo : http://github.com/cosmocode/dokuwiki-plugin-sfauth/+sourcerepo : https://github.com/cosmocode/dokuwiki-plugin-sfauth/
 donationurl:  donationurl: 
 +
 +screenshot_img: plugin:sfauth.png
 ---- ----
 +
 +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.
 +
 +[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ https://www.cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]]
  
 ===== Installation ===== ===== Installation =====
-[[http://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ http://cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]] 
  
 :!: **External requirements:** This plugin requires the following additional components that must be installed separately:  :!: **External requirements:** This plugin requires the following additional components that must be installed separately: 
   * SalesForce Account with administrator access   * SalesForce Account with administrator access
  
-Install the plugin using the [[plugin:plugin|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.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. 
 + 
 +=== Change Log === 
 + 
 +{{rss>https://github.com/cosmocode/dokuwiki-plugin-sfauth/commits/master.atom date}} 
  
 ===== Setup ===== ===== Setup =====
  
-To install this plug-in you have to do the following steps in the given order+For the setup of this plugin you have to follow the steps below in the given order.
-  - Install this plugin. +
-  - Do the "Setup at SalesForce" steps +
-  - Do the "DokuWiki Setup" steps+
  
-==== Setup at SalesForce ====+ 
 +==== At SalesForce ====
  
 === Remote Access === === Remote Access ===
 +
 +You need to register an App with oAuth access in Salesforce.
 +
 +{{ :plugin:sfauth-appsetup.png?direct&300|}}
 +
   - Login   - Login
   - Click on your name in the top toolbar   - Click on your name in the top toolbar
   - Click on ''Setup''   - Click on ''Setup''
-  - Choose ''Develop'' from the left hand navigation +  - Click on ''Create'' under ''App Setup'' in the left hand navigation 
-  - Click ''Remote Access'' +  - Click on ''Apps'' 
-  - Click ''New''+  - Under "Connected Apps" click the ''New'' button
   - Fill Form   - Fill Form
-    * use the %%https://example.com/dokuwiki/doku.php?do=login&u=a%% +    * Connected App Name: DokuWiki 
-  - Configure the plugin in the configuration manager using the data given+    * 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%%'' ((Each Salesforce Instance you configure will have a different ''sf'' parameter (starting at 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'' 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.
  
-=== Add custom profile Field === 
   - Login   - Login
   - Click on your name in the top toolbar   - Click on your name in the top toolbar
   - Click on ''Setup''   - Click on ''Setup''
-  - Click on ''Customize'' in the ''App Setup'' section+  - Click on ''Customize'' under ''App Setup'' in the left hand navigation
   - Click on ''Users''   - Click on ''Users''
   - Click on ''Fields''   - Click on ''Fields''
Line 58: Line 83:
       * Picklist (Multi-Select)       * Picklist (Multi-Select)
     - Step 2:     - Step 2:
-      * Fill out form+      * Field Label: DokuWiki Groups 
 +      * Values: enter the groups you want to assign to users 
 +      * Visible Lines: whatever you like
       * Field Name: DokuWiki_Groups       * Field Name: DokuWiki_Groups
     - Step 3:     - Step 3:
-      * Choose editor, may grand the user read only access.+      * keep defaults
     - Step 4:     - Step 4:
 +      * keep defaults
       * Save       * Save
  
-==== DokuWiki Setup ==== +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.
-  - copy the lib/plugins/sfauth/sfauth.class.php to inc/auth/sfauth.class.php +
-  - change the authtype config to sfauth.+
  
-=== Change Log ===+=== Optional: Use the wiki in a web tab ===
  
-{{rss>https://github.com/cosmocode/dokuwiki-plugin-sfauth/commits/master.atom date}}+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 http**s**. 
 + 
 +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 [[plugin:config|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 [[config:authtype|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.
  
-=== ToDo/Wish List ===+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.
  
-  * Convert to auth plugin.+You can use the groups ''salesforce1'', ''salesforce2'' and ''salesforce3'' groups to differentiate between users from different instances.
plugin/sfauth.1418905117.txt.gz · Last modified: 2014-12-18 13:18 by grosse

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki