title: Allow all domains when adding a user to Azure B2C using the Graph API
body: <p>I am trying to add a user with the email <code>...@gmail.com</code> to my B2C directory via the Graph API (C#). I get this as a response:</p>
  <blockquote>
  <p>The domain portion of the userPrincipalName property is invalid. You
  must use one of the verified domain names in your organization.</p>
  </blockquote>
  <p>This system needs to allow for users of any email domain to sign in. The users need to log in to a website, not have access to the Azure Portal.</p>
  <p>Is there a way to accomplish this without manually adding every domain?</p>
  <p>Code for adding user via Graph API:</p>
  <pre><code>var confidentialClientApplication = ConfidentialClientApplicationBuilder
      .Create(clientId)
      .WithTenantId(tenantId)
      .WithClientSecret(clientSecret)
      .Build();
  
  var authProvider = new ClientCredentialProvider(confidentialClientApplication);
              
  var graphClient = new GraphServiceClient(authProvider);
  
  var user = new User
  {
      AccountEnabled = true, 
      DisplayName = emailAddress,
      MailNickname = emailAddress.Split('@').FirstOrDefault(),
      UserPrincipalName = emailAddress,
      PasswordProfile = new PasswordProfile
      {
          ForceChangePasswordNextSignIn = true,
          Password = tempPassword
      }
  };
  </code></pre>