Custom role update & custom user attributes
-
Hi there,
I configured the plugin and it works like a charm. So far :).
I need two custom features. π And I believe they might be useful to wider audience. Probably I might code both of them myself but the question is how to get them into trunk.
1. Custom role management
a) version simplified
What is acceptable for me is to prevent SAML from updating user role after each login. This way I will have a distributed role management (role changes in IdP won’t be visible) but that is fine for me as current version of SAML plugin doesn’t support custom roles. This is a simple edit/comment in simulate_signon function in lib/classes/saml_client.php (line 147) or a slightly more complicated if we want to provide configuration option for that.b) version complex
At the moment I believe configuration is limited to mapping standard WP roles. If I want to map for example a Woocommerce Shop Manager I cannot do that. Custom mapping functionality could be a achieved with filtering settings in update_role function in same file as above. Configuration of a complex mapping would be a little more complicated as well.2. Custom user attributes
I would like to store a custom user attribute that can be provided (I hope) with SAML response. Example: phone number, company department, boss name, etc, etc. I would like to store it as a user meta field or custom field or something like that. I think this can be achieved by extending new_user function (still same file) although I have not verified if changes to some internal SAML classes. This would require slight refactoring of $login, $email, etc lines (104-108 & 119-127).Any way – what do you think?
Regards,
Piotr
The topic ‘Custom role update & custom user attributes’ is closed to new replies.