The use case in mind is that the user does not need to navigate to a certain page in order to authenticate. If the appropriate headers are present Drupal can auto login the user and assign appropriate roles based on configuration. This would be similar to the processing that currently occurs in tamauth_page() but would be done during hook_boot().
This behaviour needs to be controlled by a configuration variable for performance and security reasons.
Patch in progress - will be posted soon.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | tamauth-autologin-ui-logout-roles-6.patch | 19.06 KB | joel.gilchrist |
| #4 | tamauth-autologin-ui-logout-roles-4.patch | 18.51 KB | joel.gilchrist |
| #3 | tamauth-autologin-ui-logout-3.patch | 16.91 KB | joel.gilchrist |
| #1 | tamauth-autologin-2499649-2.patch | 4.8 KB | joel.gilchrist |
Comments
Comment #1
joel.gilchrist commentedHere's a patch. Please review.
Comment #2
joel.gilchrist commentedComment #3
joel.gilchrist commentedHi,
During testing I found that a logout capability is needed. TAM needs to be informed about the user logging out and this is done by a redirect to a TAM logout link. So a config value for that is added and a pattern from the redirect_after_logout module is used. Unfortunately that module doesn't quite meet the needs.
I also took the admin ui, security fix and hook from https://www.drupal.org/node/2328555 and merged them into this patch as is it definitely useful for my testing to have all of this in one version of the module.
Comment #4
joel.gilchrist commentedWe also have a use case where users may not have meaningful role information in TAM. So I've added a configuration parameter that dictates whether the system should expect and rely upon TAM roles and use the role mapping table or allow for managing roles in Drupal. This means the role mapping table is not used and users need to be pre-configured or after logging in once, an administrator needs to set up their roles.
This might merit it's own issue but it is so dependent upon the other changes in this thread I'm adding it here.
Also changed the validation on the logout redirect url so that it can be relative. Useful for cases where the site is behind a dns or loadbalancer and we just want to point to pkmslogout in a relative way so that if dns changes the site is unaffected.
Comment #5
skwashd commentedOverall the patch looks really good. There is a few small things that need to be fixed. I don't currently have access to a TAM enabled environment to test these changes.
Given all the additional variables, it would be cleaner if we used
system_settings_form()and did the field mapping massaging in the validation hook. That would mean we could remove this function.I find code is cleaner if you invert this test and return early. It means the whole block isn't indented.
Again this is another chance to return early.
print()print()You shouldn't need the second argument as the default is
NULL.This change makes the code less readable. Please revert it.
print()I liked the old "Nice try..." message.
count()Please document this hook in tamauth.api.php. Am I in assuming that it calls
drupal_goto()?Given the docs, these really should be booleans. The default value below should be updated to
FALSEtoo.Trailing whitespace.
The default value is NULL, is there any reason why an empty string is more desirable?
Trailing whitespace
The default value is NULL, is there any reason why an empty string is more desirable?
Comment #6
joel.gilchrist commentedChanges from #5 have been completed and tested. Please review an updated patch.
Comment #7
joel.gilchrist commented