On Aug 24, 4:16 pm, Halvor Utby <
halv...@gmail.com> wrote:
> I'm not a developer of the simplesamlphp_auth module, however I have some
> note on how we installed this module on our site. Maybe this can help you.
I guess I am one of the developers :) Finally up and running after the
vacation.
>
> *Drupal part* (we have change the simplesamlphp_auth module quite a lot to
> better suite our needs, so if something is different for you I apologize)
> 12. Download simplesamlphp_auth from:
http://drupalsimplesaml.googlecode.com/svn/trunk/simplesamlphp_auth/and put
> - "Installation directory" should be set to "/somewhere/simplesamlphp"
> - "Autenticaton source for this SP" should be set to default-sp, unless
> you have several SPs.
This will only be available if you use the trunk. If you download the
zip-file this option isn't there yet.
> - "Which attributes from simpleSAMLphp should be used as user's name" is
> up to you depending on if you have smart-name enabled in point 8. Your could
> try to login with different settings to see the difference.
Be sure that the option you select will be unique in your environment.
Depending on which attributes you have and how they are registered
this may vary.
> - "Which attribute from simpleSAMLphp should be used as unique identifier
> for the user" depends on what data you get from your idp. You could find
> this information in point 11. if I'm not mistaken.
Yes... same comment as above. If two users have the same value here
they will access the same drupal account.
unique usernames in the federation, targeted IDs and the like is good
candidates. I usually use eduPersonPrincipalName in our federeation as
I know it is unique. For more anonymous settings where the SP doesn't
get the eduPPN i probably would use a targeted ID of some kind from
the IdP.
> - "Which attribute from simpleSAMLphp should be used as user mail
> address" should be set to mail. :)
Most likely :)
> - "Automatic role population from simpleSAMLphp attributes" could be used
> to lots of useful things. I.e: We have the rule:
> 2:eduPersonPrincipalName,@=,
our.domain.com which will automatically add
> all users with names ending with
our.domain.com as type-2 users. Your
> different types of users are set in http(s)://
>
your.site.com/blog.name/admin/user/roles. The correct number is easier to
> find directly in the database.
This option really needs more documentation... :-/
> - "Force https for login links" depends on your sp and idp. I prefer to
> have it enabled for security reasons.
In production sites it really should be set to force https.
>
> 15. If you are using postgresql as we do. We get an error the first time a
> user logs in (really the user gets created within drupal). So in
> /your/drupal/installation/modules/user/user.module, about line 501: replace
> line
> if (!isset($perm[$account->uid])) {
> with
> if (!isset($perm[$account->uid]) && isset($account->roles)) {
>
> Now to your questions:
>
> - Every time a user logs in via "Login via simplesaml"-link he/she gets
> redirected to your idp. The first time, the user will also be created in
> your drupal database, but you can not use the "login provided by drupal" you
> always have to use the "Login via simplesaml" link. (We have therefore, at
> our site, add some code to the module removing the login/password box from
> drupal all together. With the "login/password box" I mean the "user login"
> block you can enable under http(s)://
>
your.site.com/blog.name/admin/build/block. The same "hack" has changed the
> http(s)://
your.site.com/blog.name/user page to not include the
> username/password fields).
>
By default you get a link on the default login page: "Click here to
login via simpleSAMLphp", and also in the login block.
I haven't found an easy way to disable/remove the default drupal login
fields. Changing the code as described above is one option or maybe
use a css to move the form way off the page.
A custom block/view/node with user friendly login information for your
federated login is probably the best option.
> - Yes, the first time a user logs in successfully trough your idp it will
> create a user within the drupal user database. However, a user is never
> authenticated directly to this datebase. Only user information and
> permissions is stored here.
Worth noting: When creating the user Drupal will generate a random
password and place it in the password field in the db.
http://api.drupal.org/api/function/user_external_login_register/6
So there is a "usable" local username password combination but nobody
knows that local password...
>
> - A user will still exist in your drupal user database, however, since the
> user no longer is valid by your idp he will no longer be able to
> authenticate himself and therefore not able to log in. The mapping is
> depending on your sp/idp configuration. Use point 11. to figure it out.
Since there is no notification from the IdP to the SP when a user
isn't a valid user at the IdP anymore deprovisioning isn't possible
directly. If you have a "back channel" from the IdP/IdM/IAM-system
telling the SP when users expire you can write some deprovisioning
code to remove local user accounts.
>
> - The user information is probably not synchronized. However, you could
> probably write that part of the code and submit it. I would definitely
> appreciate it.
Earlier versions of the module updated the information with no option
to turn it off. Currently the modules doesn't update information but
it should be possible by adding a section in simplesamlphp_auth_user
for $op='login'/'logout'.
I haven't had time to work on the module for some time... :-/
Snorre
--
Snorre Løvås
CTO
Norwegian centre for ICT in education