FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Getting 404 on user update in registration webhook after Facebook login

    Scheduled Pinned Locked Moved
    General Discussion
    2
    2
    3.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jkyser
      last edited by

      Upon user registration, we are trying to add some external ids to the user data. Currently, we have a webhook firing on the user.registration.complete event, and looks like according to the following links, we should be able to update user.data with a call to the FusionAuth API in the user.registration.complete webhook:

      https://fusionauth.io/community/forum/topic/1443/how-to-get-populated-user-data-after-user-registraion/7
      https://github.com/FusionAuth/fusionauth-issues/issues/1545

      Now, here is where we are having problems updating the user. During a simple email/password registration, this works flawlessly. We are able to use the FA client and call PatchUserAsync to add custom ids to the user. But, when a user signs in using a new Facebook login, we get a 404 returned on the PatchUserAsync call. I've done a lot of debugging, and I've confirmed on a new Facebook login, user.create is initiated along with user.registration.create afterwards. But it looks like only during a new Facebook login (maybe all new social logins?), we can't find the created user to update with some external ids.

      Here's some code for reference (using C#):

          var response = await _fusionAuthClient.PatchUserAsync(userId, new Dictionary<string, object>
          {
              { "user", request }
          });
      

      userId is the GUID we get in the event object, and request is the following object:

              var userData = new Dictionary<string, object> {
                  { "id1", "12345" },
                  { "id2", "23456" }
              };
      
              var request = new Dictionary<string, object>
              {
                  { "data", userData },
                  { "email", user.Email }
              }
      

      I'm thinking this is either a bug, or I'm misunderstanding the user object when a new registration is created for a social login. Any help is greatly appreciated!

      danD 1 Reply Last reply Reply Quote 0
      • danD
        dan @jkyser
        last edited by

        Hiya @jkyser ,

        Hmmm. What version of FusionAuth are you running?

        It looks like this is a known issue that was fixed in release 1.46.0.

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post