如何通过Web API将.NET身份数据保存在DB中
我对Web开发非常新鲜,并尝试在公共服务器上创建一个网站,该网站将通过Web API在本地数据库服务器上存储数据。我可以在某种程度上发表或从我的Web应用程序中获取数据。现在,我需要在机制中实现(Google和WS-Federation)登录机制,因此我决定使用身份,这似乎是为我做的大多数事情,这很棒,它可以创建具有必要表的DB来存储登录信息。
但我正在努力通过Web API设置身份以将数据存储在DB中。那是不正确的授权方式吗?我对此有些迷失,因此,任何帮助或建议都将不胜感激。
Im quite new with web development and trying to create a website on public server which will store data on a local DB server via web api. I got it working to a degree where I can post or get data from my web app. Now, I need to implement (google and WS-federation) log in mechanism so I decided to use Identity which seems to be doing majority of the things for me which is great, it creates DB with necessary tables to store log in info.
But I'm struggling to set up identity to store that data in DB via web api. Is that incorrect way of doing authorisation? I'm a bit lost on this one so any help or advice would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这样做的好方法是将令牌用于验证。这样您就可以通过另一台服务器进行Google身份验证,然后使用该令牌使用Web API。
I think a good way to do that is to use tokens for validation. So that you can do Google authentication by another server and then use that token to use Web APIs.
IdentityServer4