有没有一种方法可以在ASP.NET Core 3.1 Rest-API中使用Identity Server功能 [英] Is there a way to use Identity Server features in asp.net core 3.1 Rest-API

查看:59
本文介绍了有没有一种方法可以在ASP.NET Core 3.1 Rest-API中使用Identity Server功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net core 3.1在服务器中使用带有Rest-API的项目,而asp.net core 3.1则作为单页应用程序的前端.从每个客户端,用户需要提供其用户名和密码才能访问Web API的受保护部分.我想使用Identity Server的功能来访问ASP.NET Core Identity UserManager,RoleManager和SignInManagers,以确定所提供的用户名和密码是否有效.

I’m working in a project with Rest-API in the server by using asp.net core 3.1, angular as front for single page application. From each client, the user would need to supply their username and password in order to access protected parts of the web API. I would like to use the features of Identity Server to access the ASP.NET Core Identity UserManager, RoleManager, and SignInManagers to determine if the supplied username and password is valid.

我以前从未做过此事,因此尝试在Internet上进行搜索,但找不到很多信息.我想要使​​用哪些nuget软件包以及如何配置启动方面的帮助.

I haven't ever been done this before and I tried to search about this on Internet but not much info I could find. I would like some help of which nuget packages to use, and how should I configure startup.

谢谢

推荐答案

我并没有特别使用Angular来做到这一点(我使用vue),但是基本上是相同的概念.快速的Google搜索打开了Angular特定的教程,可能值得一看:https://identityserver4.readthedocs.io/zh-CN/latest/quickstarts/6_aspnet_identity.html )

I haven't done this with Angular in particular (I use vue), but it's basically the same concept. A quick Google search turned up an Angular specific tutorial that might be worth looking through: https://fullstackmark.com/post/21/user-authentication-and-identity-with-angular-aspnet-core-and-identityserver. On the IS4 side, I would suggest starting with the Asp.Net Identity IS4 template (https://identityserver4.readthedocs.io/en/latest/quickstarts/6_aspnet_identity.html)

这篇关于有没有一种方法可以在ASP.NET Core 3.1 Rest-API中使用Identity Server功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆