Skip to content

Commit 334c5fe

Browse files
committed
Updated documentation.
1 parent 6141035 commit 334c5fe

File tree

2 files changed

+31
-52
lines changed

2 files changed

+31
-52
lines changed

README.md

+23-43
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ NOTE: This is software establishes a SAML identity provider (IdP) using Drupal a
1111
### simpleSAMLphp module
1212

1313
This module for SimpleSAMLphp provides an Authentication Source for authenticating users against a local Drupal site. This allows the administrator to leverage the user management and integration capabilities of Drupal for managing the identity life cycle and the power of SimpleSAMLphp for identity integration. This is a simpleSAMLphp module, NOT a Drupal module.
14-
Download and enabme simpleSAMLmodule only if case if you want to use Drupal as Identity Provider.
14+
Download this module only if you want to use Drupal as Identity Provider.
1515

1616

1717
### Drupal modules
@@ -22,15 +22,16 @@ If you want to connect your Drupal site as Service Provider to a SAML or Shibbol
2222
## Installation
2323

2424
#### Reqirements
25-
1. Install Drupal 7.x
25+
1. Install Drupal 8.x
2626
2. Install simpleSAMLphp
27-
3. Configure SimpleSAMLphp to use something other than `phpsession` for session storage, e.g., SQL or memcache (See: `store.type` in `simplesamlphp/config/config.php`).
28-
4. Download drupalauth and unpack drupalauth
29-
5. Move the drupalauth module directory into `simplesamlphp/modules` directory
30-
6. Configure the authentication source in `simplesamlphp/config/authsources.php` as described below.
27+
3. Install drupalauth
28+
4. Configure SimpleSAMLphp to use something other than `phpsession` for session storage, e.g., SQL or memcache (See: `store.type` in `simplesamlphp/config/config.php`).
29+
5. Configure the authentication source in `simplesamlphp/config/authsources.php` as described below.
3130

3231
#### Authenticate against Drupal but use the Drupal login page
3332

33+
**Not supported yet!!!**
34+
3435
The advantage of this approach is that the SimpleSAMLphp IdP session is tied to a Drupal session. This allows the user who is already logged into the Drupal site to then navigate to a SAML SP that uses the IdP without the need to authenticate again.
3536

3637
**Details**
@@ -67,54 +68,33 @@ Configure the authentication source by putting following code into `simplesamlph
6768

6869
#### Authenticate against Drupal but use the SimpleSAMLphp login page
6970

70-
The advantage of this approach is that their is no obvious connection between SimpleSAMLphp IdP and the Drupal site.
71+
The advantage of this approach is that there is no obvious connection between SimpleSAMLphp IdP and the Drupal site.
7172

7273
**Details**
7374

7475
Configure the authentication source by putting following code into `simplesamlphp/config/authsources.php`
7576

7677
```php
77-
'drupal-userpass' => array('drupalauth:UserPass',
78+
'drupal-userpass' => array(
79+
'drupalauth:UserPass',
7880

79-
// The filesystem path of the Drupal directory.
80-
'drupalroot' => '/home/drupal',
81+
// The filesystem path of the Drupal directory.
82+
'drupalroot' => '/var/www/drupal-8.0',
8183

8284
// Whether to turn on debug
8385
'debug' => true,
8486

8587
// Which attributes should be retrieved from the Drupal site.
86-
// This can be an associate array of attribute names, or NULL, in which case
87-
// all attributes are fetched.
88-
//
89-
// If you want everything (except) the password hash do this:
90-
// 'attributes' => NULL,
91-
//
92-
// If you want to pick and choose do it like this:
93-
//'attributes' => array(
94-
// array('drupaluservar' => 'uid', 'callit' => 'uid'),
95-
// array('drupaluservar' => 'name', 'callit' => 'cn'),
96-
// array('drupaluservar' => 'mail', 'callit' => 'mail'),
97-
// array('drupaluservar' => 'field_first_name', 'callit' => 'givenName'),
98-
// array('drupaluservar' => 'field_last_name', 'callit' => 'sn'),
99-
// array('drupaluservar' => 'field_organization','callit' => 'ou'),
100-
// array('drupaluservar' => 'roles','callit' => 'roles'),
101-
// ),
102-
//
103-
// The value for 'drupaluservar' is the variable name for the attribute in the
104-
// Drupal user object.
105-
//
106-
// The value for 'callit' is the name you want the attribute to have when it's
107-
// returned after authentication. You can use the same value in both or you can
108-
// customize by putting something different in for 'callit'. For an example,
109-
// look at uid and name above.
110-
'attributes' => array(
111-
array('drupaluservar' => 'uid', 'callit' => 'uid'),
112-
array('drupaluservar' => 'name', 'callit' => 'cn'),
113-
array('drupaluservar' => 'mail', 'callit' => 'mail'),
114-
array('drupaluservar' => 'field_first_name', 'callit' => 'givenName'),
115-
array('drupaluservar' => 'field_last_name', 'callit' => 'sn'),
116-
array('drupaluservar' => 'field_organization','callit' => 'ou'),
117-
array('drupaluservar' => 'roles','callit' => 'roles'),
118-
),
88+
'attributes' => array(
89+
array('field_name' => 'uid', 'attribute_name' => 'uid'),
90+
array('field_name' => 'roles', 'attribute_name' => 'roles'),
91+
array('field_name' => 'name', 'attribute_name' => 'cn'),
92+
array('field_name' => 'mail', 'attribute_name' => 'mail'),
93+
array('field_name' => 'field_first_name', 'attribute_name' => 'givenName'),
94+
array('field_name' => 'field_last_name', 'attribute_name' => 'sn'),
95+
array('field_name' => 'field_organization', 'attribute_name' => 'ou', 'field_property' => 'target_id'),
96+
),
11997
),
12098
```
99+
100+
Leave 'attributes' empty or unset to get all available field values. Attribute names in this case would be "$field_name:$property_name".

lib/Auth/Source/UserPass.php

+8-9
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@
2222
*
2323
* To use this put something like this into config/authsources.php:
2424
*
25-
* 'drupal-userpass' => array(
26-
* 'drupalauth:UserPass',
25+
* 'drupal-userpass' => array(
26+
* 'drupalauth:UserPass',
2727
*
28-
* // The filesystem path of the Drupal directory.
29-
* 'drupalroot' => '/var/www/drupal-8.0',
28+
* // The filesystem path of the Drupal directory.
29+
* 'drupalroot' => '/var/www/drupal-8.0',
3030
*
31-
* // Whether to turn on debug
32-
* 'debug' => true,
33-
*
34-
* // Which attributes should be retrieved from the Drupal site.
31+
* // Whether to turn on debug
32+
* 'debug' => true,
3533
*
34+
* // Which attributes should be retrieved from the Drupal site.
3635
* 'attributes' => array(
3736
* array('field_name' => 'uid', 'attribute_name' => 'uid'),
3837
* array('field_name' => 'roles', 'attribute_name' => 'roles'),
@@ -42,7 +41,7 @@
4241
* array('field_name' => 'field_last_name', 'attribute_name' => 'sn'),
4342
* array('field_name' => 'field_organization', 'attribute_name' => 'ou', 'field_property' => 'target_id'),
4443
* ),
45-
* ),
44+
* ),
4645
*
4746
* Format of the 'attributes' array explained:
4847
* - field_name - name of the Drupal field.

0 commit comments

Comments
 (0)