表单身份验证问题 [英] Forms Authentication Problem

查看:68
本文介绍了表单身份验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过安全新组,以及其他地方,但还没有得到答案 - 我正在把头发拉过这个。


我正在努力让表单身份验证工作.....我可以获得任何请求

页面自动转到Login.aspx页面,和, returnURL

查询字符串在地址栏中是正确的,但无论怎样,我都无法获得

一旦用户通过身份验证,就会重定向到新的页。它始终

刷新Login.aspx页面!


我的数据库有所有用户 - 我查询数据库并验证用户

那里。这部分有效 - 我已经完全验证了这一点。

然后 - 我有这个:

如果ValidUser =" True"然后

FormsAuthentication.RedirectFromLoginPage(txtUID.t ext,True)''

< -------这部分根本不起作用 - - 它永远不会重定向

页面


machine.config指向WebUIValidation.js

文件的正确路径。 ...我正在使用MSIE,所有其他用户将会点击这个应用程序。 - - 允许编写脚本。


在Web.Config中,我有:

< authentication mode =" Forms">

< forms name =" .MyApp"

loginUrl =" login.aspx"

protection =" All"

timeout =" 480"

path =" /"

/>

< / authentication>

< authorization>

< deny users ="?" />

< / authorization>

我正在每页上导入Web.Security命名空间。

每个后续页面需要其他任何内容才能完成这项工作吗?

请帮忙 - 我已经为此工作了一个多星期了!我是什么?缺少

I tried on the Security newgroup, as well as other places, and haven''t
gotten an answer yet - - I''m pulling my hair out over this one.

I''m trying to get Forms Authentication working.....I can get any requested
page to automatically go to the Login.aspx page, AND, the ReturnURL
querystring is correct in the address bar, but no matter what, I can''t get
it, once the user is authenticated, to redirect to the new page. It ALWAYS
refreshes the Login.aspx page!

My database has all the users - - I query the database and validate the user
there. This part works - - I''ve totally verified this.
Then - - I''ve got this:
if ValidUser="True" then
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True) ''
<-------this is the part that DOES NOT work at all - - it never redirects
the page

The machine.config points to the correct path for the WebUIValidation.js
file....I''m using MSIE, as are all the other users who are going to be
hitting this app. - - Scripting is allowed.

in the Web.Config, I''ve got:
<authentication mode="Forms">
<forms name=".MyApp"
loginUrl="login.aspx"
protection="All"
timeout="480"
path="/"
/>
</authentication>
<authorization>
<deny users ="?" />
</authorization>
And I''m importing the Web.Security Namespace on each page.
Does Each subsequent page need anything else in it to make this work?
Please help - - I''ve been working on this for over a week now! What am I
missing?

推荐答案

你确定ValidUser正在返回true ?


" ElmoWatson" < SP ********** @ yahoo.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
are you sure ValidUser is returning "true" ?

"ElmoWatson" <sp**********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
我试过了在安全新组,以及其他地方,还没有得到答案 - 我正在把头发拉过这一个。

我是试图让表单身份验证工作.....我可以得到任何请求页面自动转到Login.aspx页面,并且,ReturnURL
查询字符串在地址栏中是正确的,但无论如何什么,我无法获得
它,一旦用户通过身份验证,就可以重定向到新页面。它总是刷新Login.aspx页面!

我的数据库有所有用户 - 我查询数据库并验证那里的
用户。这部分有用 - 我已经完全验证了这个。
然后 - 我有这个:
如果ValidUser =" True"然后
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext,True)''
< -------这部分根本不起作用 - 它永远不会重定向
页面

machine.config指向WebUIValidation.js
文件的正确路径....我正在使用MSIE,正如所有其他用户一样是这个应用程序。 - - 允许编写脚本。

在Web.Config中,我有:
< authentication mode =" Forms">
< forms name = " .MyApp"
loginUrl =" login.aspx"
protection =" All"
timeout =" 480"
path =" /"
/>
< / authentication>
< authorization>
< deny users ="?" />
< / authorization>
我正在每页上导入Web.Security命名空间。
每个后续页面都需要其他任何内容才能使其工作吗?请帮助 - - 我已经在这方面工作了一个多星期了!我错过了什么?
I tried on the Security newgroup, as well as other places, and haven''t
gotten an answer yet - - I''m pulling my hair out over this one.

I''m trying to get Forms Authentication working.....I can get any requested
page to automatically go to the Login.aspx page, AND, the ReturnURL
querystring is correct in the address bar, but no matter what, I can''t get
it, once the user is authenticated, to redirect to the new page. It ALWAYS
refreshes the Login.aspx page!

My database has all the users - - I query the database and validate the user there. This part works - - I''ve totally verified this.
Then - - I''ve got this:
if ValidUser="True" then
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True) ''
<-------this is the part that DOES NOT work at all - - it never redirects
the page

The machine.config points to the correct path for the WebUIValidation.js
file....I''m using MSIE, as are all the other users who are going to be
hitting this app. - - Scripting is allowed.

in the Web.Config, I''ve got:
<authentication mode="Forms">
<forms name=".MyApp"
loginUrl="login.aspx"
protection="All"
timeout="480"
path="/"
/>
</authentication>
<authorization>
<deny users ="?" />
</authorization>
And I''m importing the Web.Security Namespace on each page.
Does Each subsequent page need anything else in it to make this work?
Please help - - I''ve been working on this for over a week now! What am I
missing?



是的 - 我很确定 - 绝对正面


" Seaside" < ss@hotmail.com>在消息中写道

新闻:ez ************** @ tk2msftngp13.phx.gbl ...
Yes - I''m sure - absolutely positive

"Seaside" <ss@hotmail.com> wrote in message
news:ez**************@tk2msftngp13.phx.gbl...
你确定ValidUser是返回真实 ?

ElmoWatson < SP ********** @ yahoo.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
are you sure ValidUser is returning "true" ?

"ElmoWatson" <sp**********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
我试过安全新组,以及其他地方,还没有得到答案 - 我正在把头发拉过这个。

我正在试图获得表格身份验证工作.....我可以获得任何
请求页面自动转到Login.aspx页面,并且,ReturnURL
查询字符串在地址栏中是正确的,但无论如何,我可以't
一旦用户通过身份验证,就可以重定向到新页面。它
总是刷新Login.aspx页面!

我的数据库有所有用户 - 我查询数据库并验证
I tried on the Security newgroup, as well as other places, and haven''t
gotten an answer yet - - I''m pulling my hair out over this one.

I''m trying to get Forms Authentication working.....I can get any requested page to automatically go to the Login.aspx page, AND, the ReturnURL
querystring is correct in the address bar, but no matter what, I can''t get it, once the user is authenticated, to redirect to the new page. It ALWAYS refreshes the Login.aspx page!

My database has all the users - - I query the database and validate the


用户

那里。这部分有用 - 我已经完全验证了这个。
然后 - 我有这个:
如果ValidUser =" True"然后
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext,True)''
< -------这部分根本不起作用 - 它永远不会
重定向页面

machine.config指向WebUIValidation.js
文件的正确路径....我正在使用MSIE,正如所有其他用户一样是这个应用程序。 - - 允许编写脚本。

在Web.Config中,我有:
< authentication mode =" Forms">
< forms name = " .MyApp"
loginUrl =" login.aspx"
protection =" All"
timeout =" 480"
path =" /"
/>
< / authentication>
< authorization>
< deny users ="?" />
< / authorization>
我正在每页上导入Web.Security命名空间。
每个后续页面都需要其他任何内容才能使其工作吗?请帮助 - - 我已经在这方面工作了一个多星期了!我失踪了什么?
there. This part works - - I''ve totally verified this.
Then - - I''ve got this:
if ValidUser="True" then
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True) ''
<-------this is the part that DOES NOT work at all - - it never redirects the page

The machine.config points to the correct path for the WebUIValidation.js
file....I''m using MSIE, as are all the other users who are going to be
hitting this app. - - Scripting is allowed.

in the Web.Config, I''ve got:
<authentication mode="Forms">
<forms name=".MyApp"
loginUrl="login.aspx"
protection="All"
timeout="480"
path="/"
/>
</authentication>
<authorization>
<deny users ="?" />
</authorization>
And I''m importing the Web.Security Namespace on each page.
Does Each subsequent page need anything else in it to make this work?
Please help - - I''ve been working on this for over a week now! What am I
missing?




谢谢 - 我查了一下 - - 全部代码清单链接不要去

代码....好文章,但它并没有告诉我我的问题在哪里。

BTW - 如果我删除拒绝用户部分 - - - - 它会完全绕过login.aspx

文件。我至少有那个工作

S。 Justin Gengo < SJ ***** @ aboutfortunate.com>在消息中写道

新闻:%2 *************** @ TK2MSFTNGP12.phx.gbl ...
Thanks - I checked it out - - all the code listings links don''t go to the
code at all....nice article, but it doesn''t tell me where my problem is.
BTW - If I remove the deny users part - - - - it bypasses the login.aspx
file altogether. I at least had that working
"S. Justin Gengo" <sj*****@aboutfortunate.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Elmo,<当您使用具有表单身份验证的数据库时,您需要删除web.config文件中的拒绝用户属性。然后,您必须创建一个为您进行验证的
方法。

这是一篇关于使用带有表单身份验证的数据库的好文章:
http://www.zdnet.com。 au / builder / prog ... 0274191,00.htm
此致,

-
S. Justin Gengo,MCP
Web开发人员

免费代码库:
www.aboutfortunate.com

出于混乱,订单。Nietzche
ElmoWatson < SP ********** @ yahoo.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
Elmo,

When you use a database with forms authentication you need to remove the
deny users attribute in the web.config file. You then have to create a
method that does the validation for you.

Here''s a good article about using a database with form authentication:
http://www.zdnet.com.au/builder/prog...0274191,00.htm
Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"ElmoWatson" <sp**********@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
我试过安全新组,以及其他地方,还没有得到答案 - 我正在把头发拉过这个。

我正在试图获得表格身份验证工作.....我可以获得任何
请求页面自动转到Login.aspx页面,并且,ReturnURL
查询字符串在地址栏中是正确的,但无论如何,我可以't
一旦用户通过身份验证,就可以重定向到新页面。它
总是刷新Login.aspx页面!

我的数据库有所有用户 - 我查询数据库并验证
I tried on the Security newgroup, as well as other places, and haven''t
gotten an answer yet - - I''m pulling my hair out over this one.

I''m trying to get Forms Authentication working.....I can get any requested page to automatically go to the Login.aspx page, AND, the ReturnURL
querystring is correct in the address bar, but no matter what, I can''t get it, once the user is authenticated, to redirect to the new page. It ALWAYS refreshes the Login.aspx page!

My database has all the users - - I query the database and validate the


用户

那里。这部分有用 - 我已经完全验证了这个。
然后 - 我有这个:
如果ValidUser =" True"然后
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext,True)''
< -------这部分根本不起作用 - 它永远不会
重定向页面

machine.config指向WebUIValidation.js
文件的正确路径....我正在使用MSIE,正如所有其他用户一样是这个应用程序。 - - 允许编写脚本。

在Web.Config中,我有:
< authentication mode =" Forms">
< forms name = " .MyApp"
loginUrl =" login.aspx"
protection =" All"
timeout =" 480"
path =" /"
/>
< / authentication>
< authorization>
< deny users ="?" />
< / authorization>
我正在每页上导入Web.Security命名空间。
每个后续页面都需要其他任何内容才能使其工作吗?请帮助 - - 我已经在这方面工作了一个多星期了!我缺少什么?
there. This part works - - I''ve totally verified this.
Then - - I''ve got this:
if ValidUser="True" then
FormsAuthentication.RedirectFromLoginPage(txtUID.t ext, True) ''
<-------this is the part that DOES NOT work at all - - it never redirects the page

The machine.config points to the correct path for the WebUIValidation.js
file....I''m using MSIE, as are all the other users who are going to be
hitting this app. - - Scripting is allowed.

in the Web.Config, I''ve got:
<authentication mode="Forms">
<forms name=".MyApp"
loginUrl="login.aspx"
protection="All"
timeout="480"
path="/"
/>
</authentication>
<authorization>
<deny users ="?" />
</authorization>
And I''m importing the Web.Security Namespace on each page.
Does Each subsequent page need anything else in it to make this work?
Please help - - I''ve been working on this for over a week now! What am I
missing?




这篇关于表单身份验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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