I created an app following the steps in the video posted here (on creating the booking system):
https://docs.servicestack.net/autoquery-crud
All the endpoints work as expected in localhost. /auth/credentials
and register
work as expected as well.
But when I publish the app (using dotnet publish
and then copying the contents of the publish folder on the server - Windows Server), weirdly enough, the auth
and register
endpoints throw 404 while all the other endpoints that I created explicitly continue to work.
I am probably missing something basic but I’ve been at this for hours and can’t figure it out.
This is what my AuthFeature config looks like (most of it is exactly the same as the template created it):
appHost.Plugins.Add(new AuthFeature(() => new CustomUserSession(),
new IAuthProvider[]
{
new CredentialsAuthProvider(appSettings), /* Sign In with Username / Password credentials */
new FacebookAuthProvider(appSettings), /* Create App https://developers.facebook.com/apps */
new GoogleAuthProvider(
appSettings), /* Create App https://console.developers.google.com/apis/credentials */
new MicrosoftGraphAuthProvider(appSettings), /* Create App https://apps.dev.microsoft.com */
new JwtAuthProvider(appSettings)
{
AuthKeyBase64 = base64Key,
RequireSecureConnection = false,
UseTokenCookie = true,
CreatePayloadFilter = (payload, session) =>
{
if (session != null)
{
payload["CreatedAt"] = session.CreatedAt.ToUnixTime().ToString();
}
}
}
}));
appHost.Plugins.Add(new RegistrationFeature()); //Enable /register Service
I am not sure what else to share but happy to post any details here as needed. I can hit every other endpoint, just not the ones that seem to have been defined by the plugins.
EDIT:
Sorry, forgot to add the detail that I’m doing this via Postman. I have the following Postman config in Startup:
Plugins.Add(new PostmanFeature
{
EnableSessionExport = true
});