Microsoft LDAP AD Identity UserId or Email are always the same

Microsoft LDAP AD Identity UserId or Email are always the same

  

Hello,
can I have some with getting the email of the currently logged in user?
I'm using a Microsoft AD as login provider. On the menu the value "Username" is hard-coded. I need to display my user's email in there. When I go to expression and GetUsers.List.Current.User.Username I'm always getting the same email (first one). Am I doing something wrong ?

Thanks in advance!

Hi Aleksis,

That's difficult to say, since I don't know what you put into "GetUsers" (which I assume is an Aggregate somewhere?). It's also a bit suspect it's called "GetUsers" (plural), as I would expect a GetUser (singular) if the Aggregate retrieves a single user (the currently logged-on one).

Hi,

I guess you are retrieving all Users in your query and the Email being shown is of the first user (GetUsers.List.Current.User).

You need to filter the Aggregate. For this add the following filter: User.Id = GetUserId()

The GetUserId() is a builtin function that retrieves the UserId of the logged in User. If you filter the Users table with this Id, you will get the information for the current User.

Cheers,

João

Solution

I found a way meanwhile yesterday. I am using 

GetUserById.List.Current.User.Username

and it works.

Thanks for the answers :)) 


Solution