You are not logged in.
Hello,
I have interface based service with enabled authentication.
I need to get current user of the server.
aRestServer.SessionGetUser(aSessionID: Cardinal): TSQLAuthUser;
looks like almost what I need.
The point is I can not find is how to get current sessionId.
Could you help me?
Thanks.
Offline
is this way correct?
var
u: TSQLAuthUser;
begin
u := aRestServer.SessionGetUser(ServiceContext.Request.Session);
end;
Offline
Don't forget that you will receive a copy of TSQLAuthUser, and you must destroy it in your method.
If you only need the user ID/Name, you can use:
writeln('LogedUserID:', ServiceContext.Request.SessionUser);
writeln('LogedUserName:', ServiceContext.Request.SessionUserName);
Offline
Thanks a lot! Works.
Offline