FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. jkyser
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    jkyser

    @jkyser

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    jkyser Unfollow Follow

    Latest posts made by jkyser

    • Getting 404 on user update in registration webhook after Facebook login

      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!

      posted in General Discussion
      J
      jkyser