dotnet core 3.1 angular identity server 4 views - asp.net-core

I was playing with a new project using dotnet core 3.1, angular and individual user accounts.
After create the project I added scaffolded items for Identity.
All views are using MVC.
Is there Angular views version for this?

When we are using IdentityServer as an identity provider. We are using different approach as Individual User Accounts. So, identity provider service will handle all operations such as create, update, change password, etc.
This is the reason of why we don't have same things in Angular and IdentityServer. But you can use Skoruba project, which handle a lot of requirements.

Related

IdentityServer4 without ASP.NET Core Identity

I have a legacy app which already has implemented its own dbo structure for users, roles etc thus I don't want to use ASP.NET Core Identity.
However, I would like to implement OAuth2 functionality, so I am thinking about creating authentication server using IdentityServer4.
Can you, please, give me a hint how to wire IdentityServer4 with custom user&password dbo tables?

how to do user management with identityserver4 and asp.netcore identity

I'm building a system with 3 projects and I'm struggling with how to implement user management. I have 3 projects, an asp.net core MVC, an asp.net core Web API and an identityserver4. I want to use asp.net core identity for user management because the framework provides a lot, but I don't know where to place it. The system itself is not a big system yet, but I want it to be scalable in the future. I've read that the only thing identityserver is suppose to do is the authentication and authorization and not deal with the user management part(create users, change permission, etc.)
In the system itself, I need to have an admin that has access to the users (through the frontend MVC) and can create new or delete users, etc.
so the question is, Should i implement all the user management functions that asp.net core identity provides in the identityserver4 project or should I build it in the web API and have the two projects access the same database. I don't want the 4th project only for user management, though I know that is the ideal solution.
Currently, the mvc app only connects with the web API with the bearer token that identityserver provided.
Or, should I go in a new direction and use jwt token and asp.net core identity and only have two projects?
I'm very confused about this part, and I want to know what is the best practice.
Only Identity Server project (and any projects that are related to it) should have access to the user database. All user info a client or a API resource needs, it needs to get it from the IS its self. Now, setting up Identity Server properly depends on your needs. If you want a simple one for a few apps to use, go with a single project that can sign in users and register them, and setup your clients and API resources in the config.cs files. This is not a great way to do it though. Generally, you should have a IS project for user sign in and registration, and one more project that manages those users, as well as clients and API resources. You can see a great example of it here, it also uses ASP.NET Identity, and has a STS project(Identity Server), Admin project(User, Client, API manager) and an API project(for all related db access). Hope this helps.

How can I have JWT authorisation in a standalone .NET Core ASP application?

I have been trying for weeks to implement JWT authorisation in my .NET Core web app and have found myself following a lot of guides that I don't think are relevant to my use case. These guides talk a lot about scopes etc, and I don't think I need that level of complexity for my use case.
A lot of the guides talk about using things like OpenIddict or Identity Server to setup and configure something that the user can authorise against, but in these settings it seems like a seperate project is required to house the identity provider, and then my new asp net core application has to somehow hook into that for use. I'm also trying to get things like refresh tokens to work so the user doesn't have to log in over and over again.
The "client side" of my app will be Xamarin (for mobile) and Angular (for web).
In a single web application (a single .net core application) how can I use .NET Core Identity with JWT or OAuth? What is the minimum level of configuration required to achieve this?
ThisSimple JWT project
This is not asp.net core .This is just asp.net mvc project but this really simple and basic one. by watching this code, you will be clear how to implement JWT. Thanks

Create Individual User Accounts retroactively asp.net core 2

I have created a web application using .net core 2. When I set it up I chose no authentication. Now I would like to add individual user authentication. Is this possible once the application has been setup? Maybe a command in the pm console?
I can make another project and select authentication. Is there a list of files that I can copy over to my existing web site?
It is a little late but maybe it will help other people:
Microsoft Documentation Security
It covers scaffolding Identity in ASP.NET Core projects. More precisely:
Scaffold identity into an empty project
Scaffold identity into a Razor project without existing authorization
Scaffold identity into a Razor project with authorization
Scaffold identity into an MVC project without existing authorization
Scaffold identity into an MVC project without existing authorization
Scaffold identity into an MVC project with authorization
Create full identity UI source
Greegtings Luki

.Net 4.6 equivalent of .NET Core Identity password hashing

I have a requirement where I need to be able to create a user via a ASP.NETCore based web application and also via a windows application(.NET 4.6). The same user could be used to login to both the Web Site and the WindowsApp. The credential store used is a SQL Server database. I am using ASP.NET Core Identity with the default PasswordHashing implementation for the Web Application. But the problem that I am having is in trying to replicate the same PasswordHashing algorithm when creating users via the WindowsApplication. What is the easiest way to achieve this?
You can configure the ASP.NET Core Identity PasswordHashing implementation to use the V2 version - thus aligning with the behaviour of Identity 2 (that I'm guessing you're using in the .NET framework Windows app).
In the startup.cs of the web application, add this line:
services.Configure<PasswordHasherOptions>(options => options.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2);
All passwords created through web will have to be reset.