How to auto enroll users when using SAML/Oauth?

Hello, do you have any idea on how to perform auto-enroll on specific courses based on the users email address (domain) when first registered/logged-in using a 3rd party auth?