本文介绍了Identity Server 4和用于用户管理的Web API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用Identity Server 4和Web API的项目. Web API受ID服务器项目的保护.据我了解,将ID服务器放在自己的项目中并拥有自己的数据库是一种更好的做法.但是,我不确定如何进行用户注册.我的用户名和密码位于ID服务器中,其余用户详细信息(fname,lname,dob等)位于我的主数据库中.那么应该如何进行注册?

I have this project where I am using Identity Server 4 and Web API. The Web API is protected by the ID server project. As I understood, it is a better practice to have the ID server sit in its own project and have its own database. However, I am not sure how user registration should happen.I have my username and password sitting in the ID Server and the rest of the user details (fname, lname, dob, etc...) sittin in my main database. So how should the registration take place?

我想也许是在ID服务器上创建一个api来管理用户(创建),然后从Web api项目中调用此API.但是,如何保护此注册服务?只有Web api项目才能调用它吗?

I thought maybe to create an api in the ID server to manage the user (create) and I call this API from the web api project. But how can I protect this signup service? Only the web api project should call it?

不确定我的注册方式是否正确,因此欢迎提出任何建议.

Not sure if I am going the right way with the registration so any suggestions are welcomed.

推荐答案

您的方法正确-应该编写一些自定义的内容. Identity Server不提供用户注册OOTB,它仅使用提供的数据库(或任何其他存储).

You are going the right way - you should write something custom. Identity Server doesn't provide user registration OOTB, it just uses a database that is provided (or whatever other store).

这里的好处是,您拥有完全的自由.您可以创建一个完全独立的(称为管理员")解决方案,该解决方案可以为您完成此工作.

Good thing here is that you have a complete freedom. You can create a completely separate (let's call it) "Admin" solution, that can do this job for you.

您还可以(如您所说)使用Identity Server解决方案,在其中创建API,用IDS保护它,并将其与用于与数据库通信的服务相结合.

You can also (as you said) use the Identity Server solution, create the API there, protect it with IDS, and couple it with the services, that you use to communicate with your database.

这篇关于Identity Server 4和用于用户管理的Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 02:56