Wildcard mapping in AzureAdOAuthenticator.username_map – JupyterHub

Hello,

While I can do mapping for individual users from email to local user, I am interested in doing a wildcard mapping for all users for example some regex or * like below:
c.AzureAdOAuthenticator.username_map = {
‘*@xyz.com’: ‘*’
}

The expected result is that any username like fname.lname@xyz.com is mapped to fname.lname without having to add each user one by one in the username_map. Thx!


You can subclass the authenticator to override normalize_username which is a function:

Thank you so much @manics for the suggestion! I am new to subclass function so is there any example somewhere how to subclass the authenticator. Appreciate your help!

Read more here: Source link