简体   繁体   中英

Delphi: Datasnap Identifying User from Server Methods Unit

如何确定启动在服务器方法单元中创建的功能之一的用户?

in the ServerContainerUnit or WebModuleUnit (ISAPI),


DSAuthenticationManager.onUserAuthenticate procedure or TDSServer.onConnect ect...,


use TDSSessionManager.GetThreadSession.PutData(' UserName ',User); identify current user to DSSession,


in your Servermethods unit functions, you can use TDSSessionManager.GetThreadSession.GetData(' UserName ')from the DSSession what you saved onUserAuthenticate or other procedure.


Tested on DataSnap REST ISAPI, work fine.

如果启用了身份验证,则只需使用TDSSessionManager.GetThreadSession.Username

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM