Swagger UI and XDataMusicServer

I updated the Api.Server.Module to include a ShowSwaggerUI procedure and call that procedure from the XDataMusicServer.StartServers after the servers have been created and started. I enabled the jwt Auth for the SwaggerUI.

After the browser window is opened I receive a 401 Unauthorized on Get in the console window and an "Unauthorized" displayed in the browser window. What am I missing?

Thanks!

If you have protected your API with JWT middleware to prevent anonymous (unauthorized) access, then the SwaggerUI endpoint will also be protected. You can only access it by authenticating with a token.

If you want to allow anonymous access in specific endpoints, you can use the OnForbidRequest event and set the Forbid parameter to False for the SwaggerUI endpoint.

Thanks! I was reasonably sure it had to do with the JWT middleware, I just could not find a way around for Swagger...

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.