Forum Discussion

Mackinaw's avatar
14 years ago

Role mapping on registration based on domain?

Is it possible to associate a person with a role based on their email domain?  So if I have a role for group abc, and want anyone that registers with abc.com to be associated with that group, is that possible?  registration would be via SSO.

 

Thanks,
Paul

2 Replies

  • AdamN's avatar
    AdamN
    Khoros Alumni (Retired)
    14 years ago

    Hi Paul,

     

    Technically it would be possible via customization; however, if you're registering and signing in the user via SSO I would strongly suggest passing the role via the SSO token instead. That would be the cleanest (and likely the easiest) approach, in my opinion.

     

    If you do want to go the customization route, you can take advantage of the activity context object:

    http://lithosphere.lithium.com/t5/Developers-Knowledge-Base/Context-objects-for-custom-components-activity/ta-p/39936

    When a user registers (UserRegistered event), you could check the e-mail address in their profile and compare it to your target domain(s). If it matches, grant the role. I would strongly suggest that you ensure the e-mail address is verified prior to granting any roles based on the e-mail address.

     

    I hope this helps!