Title: Multi-valued Role Mapping
Last modified: January 7, 2021

---

# Multi-valued Role Mapping

 *  [chrisbreclaim](https://wordpress.org/support/users/chrisbreclaim/)
 * (@chrisbreclaim)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/multi-valued-role-mapping/)
 * Hi,
 * I’m currently using the plugin to get SSO set up on a site, and the last piece
   of the setup involves elevating SSO users from subscriber to author if they match
   certain criteria. We’re using a multi-valued attribute to do this, but I’m having
   a bit of trouble getting things configured.
 * I’ve enabled the “Multiple role values in one small attribute value” setting,
   and I’m using this regex for matching:
 * `/cn=([A-Za-z0-9\s _\-\/]*),/gi`
 * The data appears to be coming through as an array, and I’m trying to pull a value
   from the 1st value. I could be mistaken here, but it looks like when reading 
   the attribute used for role mapping, the plugin is reading only the 0th value
   of the array.
 *     ```
       ...
       '$ATTRIBUTE' => 
         array (
           0 => 'cn=xxx,ou=xxx,ou=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xxx',
           1 => 'cn=NEEDED_DATA,ou=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xxx',
           2 => 'cn=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,ou=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xxx',
           3 => 'cn=xxx,ou=xxx,ou=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xxx',
           4 => 'cn=xxx,ou=xxx,ou=xxx,dc=xxx,dc=xxx,dc=xxx,dc=xxx',
         ),
       ...
       ```
   
 * Is there a way to be able to pull out the needed data from the array, and if 
   so, what am I doing wrong here? Any help would be appreciated. Thank you.

The topic ‘Multi-valued Role Mapping’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/onelogin-saml-sso.svg)
 * [OneLogin SAML SSO](https://wordpress.org/plugins/onelogin-saml-sso/)
 * [Support Threads](https://wordpress.org/support/plugin/onelogin-saml-sso/)
 * [Active Topics](https://wordpress.org/support/plugin/onelogin-saml-sso/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/onelogin-saml-sso/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/onelogin-saml-sso/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [chrisbreclaim](https://wordpress.org/support/users/chrisbreclaim/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/multi-valued-role-mapping/)
 * Status: not resolved