Squidex Authentication by using NSWAG

I have…

  • [ ] Checked the logs and have provided the logs if I found something suspicious there

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [ ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

I generated Squidex API’s using NSWAG OpenAPI specification code generator. I went through code but I didn’t see any where passing Authorization Bearer token in the code.
Please let me know how to authenticate.

Expected behavior

Minimal reproduction of the problem

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [ ] Cloud version

Version: [VERSION]

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Thanks,
Manjeera T

Hi,

I use NSwag myself for the official .NET client library.

When you create a new client with Nswag, you can pass in a http client. This client can have a default headers:

See: https://github.com/Squidex/squidex-samples/blob/master/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/SquidexClientManager.cs

You can also extend the client library or just use it.