除了成员资格提供程序之外,ASP.net 还使用 URL 参数进行身份验证

发布于 2024-09-16 22:04:17 字数 290 浏览 2 评论 0原文

我当前的 ASP.net 3.5 站点使用成员资格提供程序来管理 web.config 中定义的整个站点的身份验证。

我想提供一种通过在 URL

ex 中传递用户参数来进行身份验证的附加方法。 http://site.com?user=foo&pass=bar

什么是实现此目的的最佳方法,也必须能够在调用默认身份验证之前调用它,这是我现在遇到的问题。

My current ASP.net 3.5 site uses a Membership Provider to manage authentication for the entire site defined in the web.config.

I want to provide an additional method to authenticate by passing user params in the URL

ex. http://site.com?user=foo&pass=bar

What is the best method to achieve this, also this must be able to be invoked before the default authentication is invoked which is the problem I am running into now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千寻… 2024-09-23 22:04:17

知道了。身份验证重定向到 Login.aspx。
从那里我可以从 ReturnURL 获取参数

然后

//Check if Login Params are being sent via the URL
string user = Request.QueryString["user"];
string pass = Request.QueryString["pwd"];
if ((user != null) && (pass != null))
{
     this.Authenticate(user, pass);
}
//else continue with normal login method/form...

Got it. Authentication redirects to Login.aspx.
From there I can get the params from the ReturnURL

Then

//Check if Login Params are being sent via the URL
string user = Request.QueryString["user"];
string pass = Request.QueryString["pwd"];
if ((user != null) && (pass != null))
{
     this.Authenticate(user, pass);
}
//else continue with normal login method/form...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文