delphi - How to get a token passed as header using datasnap? -


in client application i'm using following code add token in header:

restrequest.params.additem('authorization', 'bearer ' + mytoken, trestrequestparameterkind.pkhttpheader, [trestrequestparameteroption.podonotencode]); 

i'd token in server using datasnap.

i've tried use answer here , here without success.

is possible?

how can this?

edit

i verify datasnap executes tidcustomhttpserver.doparseauthenticationand doparseauthentication calls fonparseauthentication if assigned.

so, how can hack datasnap assign own onparseauthentication?

i think solve problem.

i have same problem. if authentication header used eidhttpunsupportedauthorisationscheme error, need setup onparseauthentication. started looking today , in test app "desktop" can following.

procedure tmainform.formcreate(sender: tobject); begin   fserver := tidhttpwebbrokerbridge.create(self);   fserver.onparseauthentication := doparseauthentication;// <-added line end; 

now need figure out how update asapi dll same.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -