wp-saml-auth
wp-saml-auth copied to clipboard
[FEAT-1336] WordPress role mapping
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).
Thanks @Greidal! Tracking this internally as FEAT-1336.
I also think it makes a lot of sense. Is there an ETA for this?
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.