wp-saml-auth icon indicating copy to clipboard operation
wp-saml-auth copied to clipboard

[FEAT-1336] WordPress role mapping

Open Greidal opened this issue 1 year ago • 3 comments

I didn't find any information about this already being possible, so here is my feature request:

It would be really helpful if it was possible to map roles provided by the saml provider (auth0 in my case) to Wordpress user roles (like administrator, editor...). This would enable us to make sure that by changing a role in our saml provider, all systems give the right permissions to the user (or take them away if needed).

Greidal avatar Jan 11 '24 18:01 Greidal

Thanks @Greidal! Tracking this internally as FEAT-1336.

pwtyler avatar Jan 11 '24 20:01 pwtyler

I also think it makes a lot of sense. Is there an ETA for this?

dwydler avatar Mar 17 '24 15:03 dwydler

As far as I can see following the code you should be able to do that. There are several options. The following allows the most consistent approach.

  • For new users using the wp_saml_auth_new_user_authenticated action.
  • For existing users using the wp_saml_auth_existing_user_authenticated action.

In the callback you can update the user's role based on the incoming attributes.

westende avatar Aug 06 '24 18:08 westende