带有asp.net身份注册的身份服务器4 [英] Identity server 4 with asp.net identity registration

查看:78
本文介绍了带有asp.net身份注册的身份服务器4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,如何在我的身份服务器中使用asp net身份正确实现用户注册,并在注册后重定向到登录页面,然后在使用注册帐户登录后重定向到回调URL.

I want to know, how to correctly implement user registration in my identity server with asp net identity with redirection to login page after registration and then redirection to callback URL after login with registered account.

我遵循了Identity Server 4快速入门教程,到目前为止,我使用asp.net身份创建了自己的mvc身份服务器.现在我想添加一些注册,所以我用注册表单创建了RegistrationController,并在登录表单中添加了注册"按钮.

I followed Identity Server 4 quickstart tutorial and as far i created my own mvc identity server with asp.net identity. Now i want to add some registration so i created RegistrationController with Registration form and added Register button to login form.

我有一个需要身份验证的asp.net mvc应用程序.当用户运行主页时,他会自动重定向到我的身份服务器登录页面.用户单击注册按钮,填写所需的信息,然后单击注册按钮以确认注册.注册控制器创建一个新帐户,并使用帐户管理器将其存储在数据库中.

I have an asp.net mvc application which require authentication. When user runs main page, he is automatically redirected to my identity server login page. User clicks register button, fills required information and clicks register button to confirm registration. Registration controller creates a new account and stores it in database using account manager.

这是我所缺少的部分:

成功注册后,我希望将用户重定向回登录页面,并在用户登录时将其重定向回Web应用程序并进行身份验证.

After successful registration i want an user to be redirected back to login page and when user logs in he should be redirected back to the web application and authenticated.

我是网络术语的新手,尤其是mvc.您能推荐我一些文档,在其中我可以了解更多有关解决此问题的信息吗?

I am new to the web terminology especially mvc. Can you recommend me please some documentation where i can learn more to solve this problem ?

推荐答案

在我的一个项目中,我也遇到了类似的问题,基本上,实现此所需行为的方法是在整个注册流程中保留原始的connect/authorize查询参数然后最后将用户重定向到具有原始查询参数的connect/authorize网址.

I have faced similar problem in one of my projects and basically the way we achieved this desired behavior was to retain the original connect/authorize query parameters throughout the registration flow and then at the end redirect the user back to the connect/authorize url with the original query parameters.

从那时起,所有方法都可以立即使用,因为它具有到客户端的原始回调uri,该客户端首先启动了OAuth流.

All worked out of the box from that point on since it had the original callback uri to the client that initiated the OAuth flow in the first place.

这篇关于带有asp.net身份注册的身份服务器4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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