Dan*_*llo 8 delphi indy datasnap http-headers firemonkey
在我的客户端应用程序中,我使用以下代码在标头中添加一个标记:
RESTRequest.Params.AddItem('Authorization', 'Bearer ' + MyToken, TRESTRequestParameterKind.pkHTTPHEADER, [TRESTRequestParameterOption.poDoNotEncode]);
Run Code Online (Sandbox Code Playgroud)
我想使用datasnap在我的服务器中获取此令牌.
可能吗?
我怎样才能做到这一点?
我可以验证Datasnap执行TIdCustomHTTPServer.DoParseAuthentication和DoParseAuthentication调用FOnParseAuthentication它是否已分配.
那么,我怎么能破解Datasnap分配我自己的OnParseAuthentication?
我认为这解决了我的问题.
小智 4
我也有同样的问题。如果使用 Authentication 标头,那么我们会收到 EIdHTTPUnsupportedAuthorizationScheme 错误,我需要设置 OnParseAuthentication。我今天才开始研究这个问题,在测试应用程序“桌面”中我可以执行以下操作。
procedure TMainForm.FormCreate(Sender: TObject);
begin
FServer := TIdHTTPWebBrokerBridge.Create(Self);
FServer.OnParseAuthentication := DoParseAuthentication;// <-added this line
end;
Run Code Online (Sandbox Code Playgroud)
现在我需要弄清楚如何更新 ASAPI dll 来执行相同的操作。
| 归档时间: |
|
| 查看次数: |
1264 次 |
| 最近记录: |