Skip to content

auth: Blank Shibboleth role means use existing WordPress access#37

Merged
michaelryanmcneill merged 2 commits intomichaelryanmcneill:masterfrom
jrchamp:fix_blank_default_role
May 15, 2018
Merged

auth: Blank Shibboleth role means use existing WordPress access#37
michaelryanmcneill merged 2 commits intomichaelryanmcneill:masterfrom
jrchamp:fix_blank_default_role

Conversation

@jrchamp
Copy link
Collaborator

@jrchamp jrchamp commented Feb 16, 2018

shibboleth_get_user_role() is currently used for three things:

  1. When creating a new account, it provides the initial role to set for the new account.
  2. When role updates are enabled, it provides the role to set for the existing account.
  3. When the user is logging in, if the value returned is blank, it prevents access.

The third use is not valid. shibboleth_create_new_user() already checks whether accounts can be created. shibboleth_authenticate_user() already checks to make sure an account exists. And most importantly, if the user account exists and is already tied to Shibboleth, our job as an authentication mechanism is to map the user to the user's account. Authorization should be done by WordPress based on roles that have been assigned to the user.

With this change in place, a couple things start working:

@jrchamp
Copy link
Collaborator Author

jrchamp commented Feb 16, 2018

@michaelryanmcneill If you have any questions, please ask. I feel pretty good about the code, but I'd like a critical second opinion.

@michaelryanmcneill
Copy link
Owner

I want to make sure that we still support the constants. Can you add that support in? I'll get it merged once that happens.

Copy link
Owner

@michaelryanmcneill michaelryanmcneill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to support constants for the default role, if possible. Can you add that in?

@jrchamp
Copy link
Collaborator Author

jrchamp commented Mar 16, 2018

Ok, I've added the check for SHIBBOLETH_DEFAULT_ROLE. It looks like the readme and admin-options already have this constant in place.

Do you want me to modify this sentence?

Leave this constant empty '' to make the default no allowed access.

It might be fine as is, but I get the feeling that "no role" is more accurate than "no access".

@michaelryanmcneill
Copy link
Owner

Sorry for the delay, I've just been swamped. Trying to get eyes on this to get a release moving.

@michaelryanmcneill michaelryanmcneill merged commit 1eb82cb into michaelryanmcneill:master May 15, 2018
@jrchamp jrchamp deleted the fix_blank_default_role branch August 7, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants