Membership Data
-
Currently I am using membership.data field for some purpose. Want to know if this is a bug or functionality of FusionAuth.
-
I set a field of "accountId", while creating new group.
-
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
} ], -
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.
-
-
@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.
-
@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"
}
]
}
}file:///home/sandesh/Pictures/Screenshots/Screenshot%20from%202023-08-24%2009-10-07.png
-
@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
In FusionAuth, I can see:
I then add a user to the group
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.
However, when I go into FusionAuth, I see the data associated with the user-> group
When I query the user, I get the info. Notice AccountID2 in the results.
If I query the group, I get the following. Notice the original AccountId.
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.
-
@mark-robustelli Thank you Mark..! I will keep in mind.