I am working on a 2FA solution for one of our customers and I need a way to create a user group on the fly in Code.
Is there any article on how to do this.
As We are inplimenting AD and 2FA and I need to be able to set all users who login with AD as an AD user.
Also is there a way to specify which path a user has logged in on, As I want to be able to detect if the AD users have logged in using Umbraco Login not AD login and throw them back out if they use the standard Umbraco Login
/// <summary>
/// Saves a UserGroup.
/// </summary>
/// <param name="userGroup">UserGroup to save.</param>
/// <param name="userIds">
/// If null than no changes are made to the users who are assigned to this group, however if a value is passed in
/// than all users will be removed from this group and only these users will be added.</param>
public void Save(IUserGroup userGroup, int[]? userIds = null)
{
But you say you want to put AD users into an AD group.. so can you not just create that group via the backoffice and simply apply the group during autolinking?
Or maybe you want to create new groups based on the claims returned from AD, without prior knowledge? But functionally if you aren’t aware of the groups, how do you know what permissions that group would infer in the newly created group for backoffice users?