Reputation: 680
I was trying to create a project in visual studio, I chose the option Individual User Account after selecting WebApi project, and now in VS 2019 it seems to be pretty different than before, now some parameters are requested, can anybody give me some examples of how to configure it?
It is asking about:
Domain Name
Application ID
Sign-up or Sign-in Policy
And by default it is selected like the only option to select:
Connect to an existing user store in the cloud
Upvotes: 4
Views: 2870
Reputation: 2321
That's because you are selected API project template and trying to set Individual User Accounts
mode on that but WebAPI templates don't have the Store user account in-app
feature.
If you're using MVC project and try to set the Authentication mode to Individual User Accounts you'll see the Store user accounts in-app
option.
Also, you can try to start your project in the console with this command as said in this answer:
dotnet new webapi -au Individual
You can open your project in VS after that. (to work around the dialog). Then you can use for example the authorize-attribute. But the project is still configured to use Azure Bearer Authentication. You have to decide where to get identity from. You can take identityserver4 or build your own "Custom storage providers for ASP.NET Core Identity" (MS-Docs)
This is because in MVC projects you have an account controller with views to handle registrations and get a username and password and so forth, but there's no such a thing in WebAPI and you have to use other authentication mechanisms like JWT.
There's a discussion about this feature in AspNetCore's Github.
Upvotes: 5