How to get accessTokenData of the logged in user (not application pool account) with Core Service ?
Below line retrieves the application pool account, instead of the logged in user.
AccessTokenData currentUser = tridionClient.ClientInstance.GetCurrentUser();
where tridionClient is an instance of SessionAwareCoreServiceClient
//gets current logged in username
string currentUserName = System.Web.HttpContext.Current.User.Identity.Name;
// Question : Below code retrieves current user. How do I retrieve the AccessTokenData of the retrieved user?
IdentifiableObjectData[] allUsers = tridionClient.ClientInstance.GetSystemWideList(new UsersFilterData { NameSearchMode = StringSearchMode.ExactMatch , Name = currentUserName, IsPredefined = false, BaseColumns = ListBaseColumns.Id });
foreach (IdentifiableObjectData user in allUsers)
{
UserData thisUser = (UserData)tridionClient.ClientInstance.Read(checkUser.Id, readOptions);
if (thisUser.Title == currentUserName)
{
currentUser = thisUser;
}
}
AccessTokenData ICoreService201603.GetCurrentUser
![enter image description here](i.sstatic.net/pAyai.png)