I need to access the UserId of my Users, so I guess this can be done by extending user.shared and AuthenticationService. It is my goal to access the UserId (which is a "Guid") at the client side, by default this is not possible.
@ User.shared I added these lines:
/// <summary>
/// Gets the UserId of the user.
/// </summary>
public Guid UserId { get; private set; }
Here the AuthenticationService class - what do I need to insert here in order to return the UserId ??
[EnableClientAccess]
public class AuthenticationService : AuthenticationBase<User>
{
//adapt GetAuthenticatdUser in order to be able to retrieve the UserId @ the client !
protected override User GetAuthenticatedUser(System.Security.Principal.IPrincipal principal)
{
return base.GetAuthenticatedUser(principal);
//what does this line above actually do ?!!?
//INSERT statement which returns the UserId (Guid)
}
}
THX to all of you guys - have lost at least 1 hour already on this topic :-(.