Unauthorized in HTTPApi after updating to v10

Hi,

After updating to SDK 10 we just get unauthorized messages after trying to log in to HTTPApi. Is this a bug or some breaking change?

Thanks,

Hello

Could you provide more details (or, even better, a send testcase to support@)?

Regards

Hi,

Here is the Delphi call to a test .NET app that calls the LoginService like in the Delphi examples.

When I compile on another VM with the previous version (Think it was 9) it works. On version 10 the login method is not called and results in a 401 error.

Thanks,

Unfortunately these code screenshots are not enough to diagnose the issue.

Please provide a testcase.

Hi,

check the HttpApi Authentication sample.
it demonstrates how to allow to execute loginService.login w/o requirement of session

Hi,

We need a session to store values upon login.

I have removed most services from the project and the client too. There is a .NET test app that connects to the server at localhost to show the problem.

Thanks

Hi,

if you open your httpapi declaration in https://editor.swagger.io/ , you will see


it means that for executing this method, you should provide existing apiKey that should be present on server-side.

this behavior is incorrect.
check the HttpApi Authentication sample and add

procedure TServerDataModule.ROHttpApiSimpleAuthenticationManager1CanWriteMethodSecurity(
  aServiceName, aMethodName: string; var CanWrite: Boolean);
begin
  CanWrite := not((aServiceName = 'LoginService') and (aMethodName = 'Login'));
end;

after this,


and

>HttpApiTest.exe
Logged in: True

Thanks maybe that changed since the verion I have.