Mark LFT
Mark LFT

Reputation: 151

How to authenticate to a ServiceStack API which is part of a .Net 5 Identity MVC Website

I have a test project based on the .Net 5 ServiceStack mvcidentity sample. For web-based access, the authentication works as expected.

Accessing the API directly from another app for the hello sample works as no authentication is required. However, if I try to connect to one of the API Methods that requires Authentication, I receive an error message that no auth providers are defined.

Based on this sample, what is the correct way to access one of the authentication required methods from an application on another computer, where there would not be a user to login? I presume we would need to add a basic authentication or something similar in the authentication pipeline?

Upvotes: 0

Views: 94

Answers (1)

mythz
mythz

Reputation: 143284

If you're using the mvcidenity project template you're using ASP .NET Core Identity for authentication (as opposed to ServiceStack Auth) which you'll need to use for any authorization, e.g. you can use a IAuthorizationFilter to implement HTTP Basic Auth.

Upvotes: 0

Related Questions