You might want to automatically assign reader groups based on a readers' email address. For example, we might want to assign all readers with "@knowledgeowl.com" email addresses to a special Owls Only reader group.
If we're using SSO, we can do this using Custom attribute map rules in Security and access > Single sign-on > SAML attribute map tab.
Only use this with SSO
There's also an option under Account > Readers > Groups to Auto-Assign Groups By Email Rules. That setting doesn't work with SSO. If you're using SSO, follow the instructions below!
Prerequisites:
- SSO is set up and working
- Email address is being passed over
- IdP attribute name for the email address field
To set up a Custom attribute map rule to automatically assign readers to groups based on an email address:
- Go to Security and access > Single sign-on.
- Select the SAML Attribute Map tab.
- Copy the IdP attribute name for Username / email under SAML attribute map.
- If you don't have an email address in Username / Email, go to the SAML settings tab and check the box to Enable debug mode to troubleshoot issues, Save, and try logging in. Debug mode will show you the IdP attribute names and values being passed over from your IdP.
- Scroll down to Custom attribute map rules.
- Select + Create New Rule. The Create Advanced SAML Map Rule modal opens for you to define the rule.
- Enter the IdP attribute name that includes the email address.
- In the IdP attribute value matching type section, select Regex pattern.
- Copy the code below and paste it into the IdP value regex pattern:
.*\@knowledgeowl([\.])com
- Replace knowledgeowl with your email domain (and com with your domain ending, if it's not a .com!). So, for example, if our email domain was owlmazing.net, we would use:
.*\@owlmazing([\.])net
- Select Reader Groups from the Reader attribute dropdown.
- Start typing to select the reader group(s) to which you want to assign any SSO readers with matching email addresses. Your configuration should look something like this:
- Once you've finished adding groups and verified that all information is correct, select Create Rule.
- Now any readers who log in with matching email addresses should be automatically assigned to the selected reader group(s).