Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT-1336] WordPress role mapping #368

Open
Greidal opened this issue Jan 11, 2024 · 3 comments
Open

[FEAT-1336] WordPress role mapping #368

Greidal opened this issue Jan 11, 2024 · 3 comments

Comments

@Greidal
Copy link

Greidal commented Jan 11, 2024

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).

@pwtyler pwtyler changed the title Wordpress role mapping [FEAT-1336] WordPress role mapping Jan 11, 2024
@pwtyler
Copy link
Member

pwtyler commented Jan 11, 2024

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

@dwydler
Copy link

dwydler commented Mar 17, 2024

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

@westende
Copy link

westende commented Aug 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants