<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Unable to create a registration using the .NET core client]]></title><description><![CDATA[<p dir="auto">Hiya,</p>
<p dir="auto">I'm unable to create a user registration using the .NET client libraries: <a href="https://fusionauth.io/docs/v1/tech/client-libraries/netcore" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/client-libraries/netcore</a></p>
<p dir="auto">I have verified that the API key is basically a super user. I've verified that I'm sending the registration object. I've tried twiddling different properties (verified, insertInstant) and made sure that the application exists. I've added the a user registration to the application manually and it works. Creating a user and setting the userdata works just fine. It just seems like the registration isn't working.</p>
<p dir="auto">I looked in <a href="https://github.com/FusionAuth/fusionauth-netcore-client/issues" rel="nofollow ugc">https://github.com/FusionAuth/fusionauth-netcore-client/issues</a> and <a href="https://github.com/FusionAuth/fusionauth-issues/issues" rel="nofollow ugc">https://github.com/FusionAuth/fusionauth-issues/issues</a> but didn't see any relevant issues.</p>
<p dir="auto">Here's my code so far (you can run it with <code>fusionauth_api_key=&lt;key&gt; dotnet.exe run --  foo@foo5.com bluepass123 blue</code>)</p>
<pre><code>$ cat usermanager.csproj
&lt;Project Sdk="Microsoft.NET.Sdk"&gt;

  &lt;PropertyGroup&gt;
    &lt;OutputType&gt;Exe&lt;/OutputType&gt;
    &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
  &lt;/PropertyGroup&gt;

  &lt;ItemGroup&gt;
    &lt;PackageReference Include="FusionAuth.Client" Version="1.15.7" /&gt;
    &lt;PackageReference Include="JSON.Net" Version="1.0.18" /&gt;
  &lt;/ItemGroup&gt;

&lt;/Project&gt;
</code></pre>
<pre><code>$ cat Program.cs
using System;
using io.fusionauth;
using io.fusionauth.domain;
using io.fusionauth.domain.api;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace usermanager
{
    class Program
    {
        private static readonly string apiKey = Environment.GetEnvironmentVariable("fusionauth_api_key");
        private static readonly string fusionauthURL = "http://localhost:9011";

        private static readonly string tenantId = "66636432-3932-3836-6630-656464383862";
        static void Main(string[] args)
        {
            if (args.Length != 3) {
                Console.WriteLine("Please provide email, password and favorite color.");
                Environment.Exit(1);
            }
            string email= args[0];
            string password = args[1];
            string favoriteColor = args[2];

            FusionAuthSyncClient client = new FusionAuthSyncClient(apiKey, fusionauthURL, tenantId);
            User userToCreate = new User();
            userToCreate.email = email;
            userToCreate.password = password;
            Dictionary&lt;string, object&gt; data = new Dictionary&lt;string, object&gt;();
            data.Add("favoriteColor", favoriteColor);
            userToCreate.data = data;
            UserRegistration registration = new UserRegistration();
            registration.applicationId = Guid.Parse("4243b56f-0b45-4882-aa23-ac75eea22d22");
            registration.verified = true;

            registration.insertInstant = DateTimeOffset.UtcNow;
            var registrations = new List&lt;UserRegistration&gt;();
            registrations.Add(registration);

            userToCreate.registrations = registrations;

            UserRequest userRequest = new UserRequest();
            userRequest.sendSetPasswordEmail = false;
            userRequest.user = userToCreate;
            string u = JsonConvert.SerializeObject(userRequest);
            Console.WriteLine(u);
            var response = client.CreateUser(null, userRequest);
            string json = JsonConvert.SerializeObject(response);
            Console.WriteLine(json);

            if (response.WasSuccessful())
            {
                var user = response.successResponse.user;
                Console.WriteLine("retrieved user with email: "+user.email);
            }
            else if (response.statusCode != 200)
            {
                var statusCode = response.statusCode;
                Console.WriteLine("failed with status "+statusCode);
            }
        }
    }
}
</code></pre>
]]></description><link>https://fusionauth.io/community/forum/topic/7/unable-to-create-a-registration-using-the-net-core-client</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 19:48:27 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/7.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Apr 2020 18:00:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unable to create a registration using the .NET core client on Wed, 22 Apr 2020 18:22:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://fusionauth.io/community/forum/uid/3">@robotdan</a> Ah, I missed that. I was looking at the response section, which had the registration. Thanks!</p>
]]></description><link>https://fusionauth.io/community/forum/post/16</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/16</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Wed, 22 Apr 2020 18:22:05 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to create a registration using the .NET core client on Wed, 22 Apr 2020 18:17:25 GMT]]></title><description><![CDATA[<p dir="auto">The User API will not create a registration, the registration portion of your request object is being ignored.</p>
<p dir="auto">If you review the User API, you will notice that the <code>registration</code> is not part of the request body.<br />
<a href="https://fusionauth.io/docs/v1/tech/apis/users#create-a-user" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/apis/users#create-a-user</a></p>
<p dir="auto">You can optionally create the user and then create a registration separately.<br />
<a href="https://fusionauth.io/docs/v1/tech/apis/users#create-a-user" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/apis/users#create-a-user</a><br />
<a href="https://fusionauth.io/docs/v1/tech/apis/registrations#create-a-user-registration-for-an-existing-user" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/apis/registrations#create-a-user-registration-for-an-existing-user</a></p>
<p dir="auto">We do offer a combo API that allows you to create a User and a User Registration in one go. To use this strategy, use the Combo version of the User Registration API.</p>
<p dir="auto"><a href="https://fusionauth.io/docs/v1/tech/apis/registrations#create-a-user-and-registration-combined" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/apis/registrations#create-a-user-and-registration-combined</a></p>
<p dir="auto">Thanks!</p>
]]></description><link>https://fusionauth.io/community/forum/post/15</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/15</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 22 Apr 2020 18:17:25 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to create a registration using the .NET core client on Wed, 22 Apr 2020 18:17:11 GMT]]></title><description><![CDATA[<p dir="auto">Here's the JSON output of the response:</p>
<pre><code>{"statusCode":200,"successResponse":{"user":{"active":true,"data":{"favoriteColor":"blue"},"email":"foo@foo6.com","insertInstant":1587579258792,"tenantId":"66636432-3932-3836-6630-656464383862","twoFactorDelivery":"None","twoFactorEnabled":false,"usernameStatus":"ACTIVE","breachedPasswordStatus":"None","id":"ca0954d0-28e5-4b76-9260-0cca0893cba6","passwordChangeReason":"Administrative","passwordChangeRequired":false,"passwordLastUpdateInstant":1587579258834,"verified":true}}}
</code></pre>
]]></description><link>https://fusionauth.io/community/forum/post/14</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/14</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Wed, 22 Apr 2020 18:17:11 GMT</pubDate></item></channel></rss>