Authentication custom CredentialsAuthProvider browser only

I have a custom CredentialsAuthProvider implementation that works when I call it from code using JsonServiceClient, as well as when I am running it locally (localhost:5001) but when i try to run any of the Authenicate decorated queries from Edge on the deployed servier I get forwarded to the login, after logging in i get a 404 Error on auth/credentials

I have created a new project using x new empty with no changes except adding the authentication and decorated the Hello query with Authenticate and same thing.

Is there something i can try to debug this? It is not really a show stopper but i do use browsers to test queries.

Additional information.

The server is an Azure VM (win server 2019 datacenter version 1809 fresh install)
Unfortunately, I have deployed so many things to my previous server that I am not sure what I may have installed that makes it work on that server.
On the new server i have installed the hosting bundle for .net5 and .net6

We have limited IT staffing so I would like to be able to leverage our AD to authenticate and authorize the different queries and not have to establish new users in a separate db.

Any help you could pass on would be much appreciated.

By the way…
Noticed that when running in debug styling looks like this


where in production styling is like this

A 404 sounds suspicious, like you’re being redirected to the wrong route. Best way to diagnose any integration issues like this is to check the raw HTTP Request/Response headers to help identify the cause of the error.

For diagnosing remote issues the Request Logger can help for logging full details of the requests that it receives:
https://docs.servicestack.net/request-logger

So the solution for me was to add the HandlerFactoryPath for my project I was able to use
HandlerFactoryPath = AppHost.Instance.ServiceName.

I don’t know if I needed to but for completeness and for anyone else searching this. I called App.UsePathBase("/" + AppHost.Instance.ServiceName) trying to make it simpler for running in both IIS Express and IIS Local.

Thanks for the help.

Derek

1 Like