English 中文(简体)
Delphi XE2 DataSnap - Access REST联结业,服务器方法模块
原标题:Delphi XE2 DataSnap - Access REST connection properties in server methods module

I m 建造一个XE2数据Snap服务器,为来自REE客户的链接服务。 My DSServerClass LifeCycle property is set to Insign . REST的连接特性将包括用户名称和密码,通过DSAuthenticationManager用户Authenticate()活动处理。 我需要知道的是,我如何能够在服务器方法类别中查阅用户名和密码? 我想能够知道,REST用户名/密码发射了我的服务器类别的标本。

最佳回答

你们可以使用安全局。 起草:

procedure TServerContainerTest.DSServerClass1Prepare(
  DSPrepareEventObject: TDSPrepareEventObject);
begin
  // Add username property to TServerMethodsTest
  if DSPrepareEventObject.MethodInstance is TServerMethodsTest then
    TServerMethodsTest(DSPrepareEventObject.MethodInstance).Username := DSPrepareEventObject.UserName;
end;

There s is no password available. Don t use Server LifeCycle for this!

问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签