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

    Membership Data

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    5
    890
    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.
    • S
      sandesh
      last edited by

      Currently I am using membership.data field for some purpose. Want to know if this is a bug or functionality of FusionAuth.

      1. I set a field of "accountId", while creating new group.
        2d85da8e-b5be-44fd-afc5-5586f02680c2-image.png

      2. Later when I link this group to any user, I cannot see the same field in the token as required.
        "memberships" : [ {
        "data" : { },
        "groupId" : "96b633e1-b102-4de8-8e5a-c697e871480d",
        "id" : "0f35b49d-2ca9-4273-9ff0-15e5d6081b97",
        "insertInstant" : 1691163717381
        }, {
        "data" : { },
        "groupId" : "5d6ccea1-2e90-4fed-8475-5dd7491a5def",
        "id" : "fc86e677-7fd9-479b-a494-20c58d824a05",
        "insertInstant" : 1692012015554
        } ],

      3. When I populate the same data while creating user, the data is populated as required.
        "memberships" : [ {
        "data" : {
        "accounId" : "qweqwe"
        },

        "groupId" : "5d6ccea1-2e90-4fed-8475-5dd7491a5def",
        "id" : "6a5cde21-5834-43c5-8ad7-30bf4e8fc4c4",
        "insertInstant" : 1691940338172
        } ],

      If this is a bug, any rough idea how much time will it take for resolution.

      mark.robustelliM 1 Reply Last reply Reply Quote 0
      • mark.robustelliM
        mark.robustelli @sandesh
        last edited by

        @sandesh Can you please give a little more detail on how you are adding this field and trying to retrieve the value? Are you doing this all through the APIs and Postman or something like that? Please give the steps to replicate in a little more detail.

        S 1 Reply Last reply Reply Quote 0
        • S
          sandesh @mark.robustelli
          last edited by

          @mark-robustelli You can check the below sample JSON file to add an User assuming you have already added a similar group as mentioned in the first screenshot. You can try adding the data part and removing it. Make sure that the group that you are using has a data field accountId ( or any ) which should reflect in the source tab of User e.g. last screenshot. There could be some understanding issue from my side, please let me know.

          {
          "user": {
          "firstName": "Sandy",
          "lastName": "G",
          "companyName": "Valo",
          "email": "sandesh@asd.com",
          "password": "asfasfasd",
          "memberships": [
          {
          "data" : {
          "accounId" : "qweqwe"
          },

          "groupId": "25f7cc16-6746-41bd-9948-1e2397519f7c"
          }
          ]
          }
          }

          eb3bc4e7-ed55-4cb1-85b3-98919142845e-Screenshot from 2023-08-24 09-10-07.png file:///home/sandesh/Pictures/Screenshots/Screenshot%20from%202023-08-24%2009-10-07.png

          1 Reply Last reply Reply Quote 0
          • mark.robustelliM
            mark.robustelli
            last edited by mark.robustelli

            @sandesh I think I know what is going on. So when you create the group, that data is associated with that group. When you add data to link the user to the group. That data is associated with that user-group connection.

            Here are the steps that I hope help make sense of this.

            I create a group using the APIs, add accountId and see it in the results

            Screenshot 2023-08-24 at 11.43.01 AM.png

            In FusionAuth, I can see:
            Screenshot 2023-08-24 at 11.44.29 AM.png

            I then add a user to the group
            Screenshot 2023-08-24 at 11.46.09 AM.png

            and don't see the data returned.

            When I add, the data to the user creation, I see it returned. Notice I use AccountID2 here to be different.
            Screenshot 2023-08-24 at 11.47.45 AM.png

            However, when I go into FusionAuth, I see the data associated with the user-> group
            Screenshot 2023-08-24 at 11.49.06 AM.png

            When I query the user, I get the info. Notice AccountID2 in the results.
            Screenshot 2023-08-24 at 11.50.20 AM.png

            If I query the group, I get the following. Notice the original AccountId.
            Screenshot 2023-08-24 at 11.52.03 AM.png

            I hope this explains it. If not and you want to get the accountID for the group, you should just able to query the group as a work around.

            S 1 Reply Last reply Reply Quote 1
            • S
              sandesh @mark.robustelli
              last edited by

              @mark-robustelli Thank you Mark..! I will keep in mind.

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