开发者

ASP.net Authenticate with URL params in addition to Membership Provider

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

开发者_如何学PythonI 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.


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...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜