You are not logged in.
Pages: 1
Hello,
I am trying to build my own custom authentication method for my REST server.
I have created my own class (TSQLRestServerAuthenticationHttpToken) derived from yours, and on the server side I register it like this:
Model:=TSQLModel.Create([Tc2dAuthUser,TSQLauthGroup]);
// create the main mORMot server
RestSrv:=TSQLRestServerDB.Create(Model,':memory:',false); // authentication=false
try
RestSrv.CreateMissingTables; // create tables or fields if missing
restSrv.AuthenticationRegister(TSQLRestServerAuthenticationHttpToken);
But on the client side I doesn't seem to be able to specify which auth scheme the server is expected to use. In fact:
amodel := TSQLModel.Create([TSQLAuthUser],collname);
aClient := TSQLHttpClientWinHTTP.Create(addr,SERVER_PORT,aModel,false);
aclient.AuthScheme //// this one can only be one of the schemes defined by you
if not aClient.SetUser('Admin','synopse',false) then
In fact the AuthScheme property can only be:
THttpRequestAuthentication = (wraNone,wraBasic,wraDigest,wraNegotiate);
And then based upon the value given to AuthScheme you pick one of your pre-defined auth schemes for the client side.
How can I tell the client to use my own auth scheme on the client side?
Thank you.
Offline
Try this:
TSQLRestServerAuthenticationHttpToken.ClientSetUser(aClient, 'login', 'password');
Offline
Pages: 1