public Lite <UserEntity> CreateADUser([FromBody][Required] ActiveDirectoryUser user)
        {
            var config = ((ActiveDirectoryAuthorizer)AuthLogic.Authorizer !).GetConfig();

            if (config.Azure_ApplicationID.HasText())
            {
                return(MicrosoftGraphLogic.CreateUserFromAD(user).ToLite());
            }

            if (config.DomainName.HasText())
            {
                return(ActiveDirectoryLogic.CreateUserFromAD(user).ToLite());
            }

            throw new InvalidOperationException($"Neither {nameof(config.Azure_ApplicationID)} or {nameof(config.DomainName)} are set in {config.GetType().Name}");
        }
Пример #2
0
 public Lite <UserEntity> CreateADUser([FromBody][Required] ActiveDirectoryUser user)
 {
     return(MicrosoftGraphLogic.CreateUserFromAD(user).ToLite());
 }