You are not logged in.
I am new to mORMot, so bear with me.
I wrote a client and server (loosely based on the third party demo "George REST Tester" code). It does authentication and authorization perfectly. The client can call various interfaced methods on the server. So far, so good and everything works great.
Now I need to integrate the mORMot server with a database used by another product.
How do I retrieve the authentication information for the _current session_ inside an interfaced RestMethod? I need to retrieve the user's login name so that I can look them up in an external database. Dozens of Clients will be connecting to my Server, several at a time, so I need to know which one is calling each method.
I see that TInjectableObjectRest.fServer keeps track of all of its sessions, but how do I know which session is accessing a particular RestMethod?
Thanks in advance!
Offline
Offline
Thanks! The link got me started.
For the lurkers:
ServiceContext.Request.SessionUserName
Returns the login name of the current user when using interfaced REST methods. There are a several other fields and methods associated with Request that are useful for identifying the user too.
Offline