Hello Community,
Looking at the result of a Rest call to rest/prototype/1/search/user.json , I can see one of the results as:
"id": "1146881", "type": "user", "title": "Group1User1", "wikiLink": "[~g1u1]", "createdDate": {...}, "creator": { ...}, "lastModifier":{...}, "username": "g1u1", "userKey": "2c99dbad4e2ee94f014e2ef92bf90001", "thumbnailLink": { ...}
It seems there are 2 unique identifiers for a User:
Why do we have 2 unique identifiers ?
I can access "userKey" using via a ConfluenceUser object, but how can I access "id" information from Java code ?
Thanks,
Colin
Community moderators have prevented the ability to post new answers.
Giving you a background for your first question, currently in confluence we have two main tables that hold the user information:
The id is the key used to bind a user into a group through the cwd_membership table, the user key is a hash used to represent the user from the cwd_user in user_mapping table.
In the past, prior 5.2.3 all the references in confluence where made against the user_name instead an id, that used to cause a lot of problems on the user management area (duplicated users, not able to rename users, permissions being lost).
In 5.2.3 atlassian added the user_mapping table and updated every table to make reference to the user_key instead the user name. That made possible for users to rename their logins and even if they had content created and also reduced those problems I listed previously.
As for accessing the id information I don't know how to achieve that .
Hi Lavitz, Thanks for clarification, I might be able to search in right direction. I need this ID to generate links to user profile (not using the username, Atlassian do this by generating links to : {host}/rest/prototype/1/content/{user_id}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like I should find a way to get this object: https://docs.atlassian.com/confluence/latest/com/atlassian/confluence/it/UserInformation.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I was able to help you ;).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a way to connect a user_name to a user_key or merge user_keys? We switched from built-in authentication to Active Directory and at least one user shows up as "unknown user" in the "Created" and "Modified" lines on pages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is not impossible, depending on the scenario you have, can you raise a new answer topic asking for that and commenting as a reply to this comment so we can better organize this post? If you do that I can ask you a couple questions to better assist you :).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.