I am trying to password protect a subdirectory using forms authentication. I
am using the "Location" tag to specify the directory to be protected. The
login.aspx page is in the root directory of the app. Here is the web.config:
<location path="Admin">
<system.web>
<authentication mode="Forms">
<forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="Admin" password="pass"/>
<user name="Ashlyinn" password="pass"/>
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
The problem is event if I put in the proper valid credentials authorization
fails.
Any suggestions?
Thanks, Justin. 7 1985
Hey Justin,
When u mean authorization do u mean th user can login but he is not
getting the appropriate resources?
That means is he authenticated?
"Justin" wrote: I am trying to password protect a subdirectory using forms authentication. I am using the "Location" tag to specify the directory to be protected. The login.aspx page is in the root directory of the app. Here is the web.config:
<location path="Admin"> <system.web> <authentication mode="Forms"> <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> <credentials passwordFormat="Clear"> <user name="Admin" password="pass"/> <user name="Ashlyinn" password="pass"/> </credentials> </forms> </authentication> <authorization> <deny users="?"/> </authorization> </system.web> </location>
The problem is event if I put in the proper valid credentials authorization fails.
Any suggestions?
Thanks, Justin.
No, the user is not authenticated at all, meaning it goes to the else
statement in the code below no matter what:
private void Login_Click(object sender, System.EventArgs e)
{
if (FormsAuthentication.Authenticate(Email.Text, Password.Text))
{
FormsAuthentication.RedirectFromLoginPage(Email.Te xt, false);
}
else
{
lblStatus.Text = "Authentication Failed.";
}
}
"Patrick.O.Ige" wrote: Hey Justin, When u mean authorization do u mean th user can login but he is not getting the appropriate resources? That means is he authenticated? "Justin" wrote:
I am trying to password protect a subdirectory using forms authentication. I am using the "Location" tag to specify the directory to be protected. The login.aspx page is in the root directory of the app. Here is the web.config:
<location path="Admin"> <system.web> <authentication mode="Forms"> <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> <credentials passwordFormat="Clear"> <user name="Admin" password="pass"/> <user name="Ashlyinn" password="pass"/> </credentials> </forms> </authentication> <authorization> <deny users="?"/> </authorization> </system.web> </location>
The problem is event if I put in the proper valid credentials authorization fails.
Any suggestions?
Thanks, Justin.
Ok Justin so No authentication at al!!
Are u sure u have all the right settings?
First check to see whether u have Anonymous Auth checked in IIS.
Got to ur WebServer and right click on ur Virtual Directory of ur
Application >Go to Properties >Directory security TAB> On the Anonymouse
Access and Auth control
click EDIT and make sure u check Anonymous access!
Also make sure u have :- <identity impersonate="true" /> placed in ur
web.config
Try all that!
Let me know if it works for u..if not post ur Question.
"Justin" wrote: No, the user is not authenticated at all, meaning it goes to the else statement in the code below no matter what:
private void Login_Click(object sender, System.EventArgs e) { if (FormsAuthentication.Authenticate(Email.Text, Password.Text)) { FormsAuthentication.RedirectFromLoginPage(Email.Te xt, false); } else { lblStatus.Text = "Authentication Failed."; } } "Patrick.O.Ige" wrote:
Hey Justin, When u mean authorization do u mean th user can login but he is not getting the appropriate resources? That means is he authenticated? "Justin" wrote:
I am trying to password protect a subdirectory using forms authentication. I am using the "Location" tag to specify the directory to be protected. The login.aspx page is in the root directory of the app. Here is the web.config:
<location path="Admin"> <system.web> <authentication mode="Forms"> <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> <credentials passwordFormat="Clear"> <user name="Admin" password="pass"/> <user name="Ashlyinn" password="pass"/> </credentials> </forms> </authentication> <authorization> <deny users="?"/> </authorization> </system.web> </location>
The problem is event if I put in the proper valid credentials authorization fails.
Any suggestions?
Thanks, Justin.
Well, unfortunetly it still does not work. I am sure its something simle but
sometimes simple problems are hard to fix.
Thanks for the help.
Justin.
"Patrick.O.Ige" wrote: Ok Justin so No authentication at al!! Are u sure u have all the right settings? First check to see whether u have Anonymous Auth checked in IIS. Got to ur WebServer and right click on ur Virtual Directory of ur Application >Go to Properties >Directory security TAB> On the Anonymouse Access and Auth control click EDIT and make sure u check Anonymous access! Also make sure u have :- <identity impersonate="true" /> placed in ur web.config Try all that! Let me know if it works for u..if not post ur Question. "Justin" wrote:
No, the user is not authenticated at all, meaning it goes to the else statement in the code below no matter what:
private void Login_Click(object sender, System.EventArgs e) { if (FormsAuthentication.Authenticate(Email.Text, Password.Text)) { FormsAuthentication.RedirectFromLoginPage(Email.Te xt, false); } else { lblStatus.Text = "Authentication Failed."; } } "Patrick.O.Ige" wrote:
Hey Justin, When u mean authorization do u mean th user can login but he is not getting the appropriate resources? That means is he authenticated? "Justin" wrote:
> I am trying to password protect a subdirectory using forms authentication. I > am using the "Location" tag to specify the directory to be protected. The > login.aspx page is in the root directory of the app. Here is the web.config: > > <location path="Admin"> > <system.web> > <authentication mode="Forms"> > <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> > <credentials passwordFormat="Clear"> > <user name="Admin" password="pass"/> > <user name="Ashlyinn" password="pass"/> > </credentials> > </forms> > </authentication> > <authorization> > <deny users="?"/> > </authorization> > </system.web> > </location> > > The problem is event if I put in the proper valid credentials authorization > fails. > > Any suggestions? > > Thanks, Justin.
Just try looking through ur code carefully ok!
Justin try looking through:-Forms Authentication here:- http://samples.gotdotnet.com/quickstart/aspplus/
o http://support.microsoft.com/default...301240&SD=MSDN
or http://www.costudio.com/form_auth.asp
"Justin" wrote: Well, unfortunetly it still does not work. I am sure its something simle but sometimes simple problems are hard to fix.
Thanks for the help.
Justin.
"Patrick.O.Ige" wrote:
Ok Justin so No authentication at al!! Are u sure u have all the right settings? First check to see whether u have Anonymous Auth checked in IIS. Got to ur WebServer and right click on ur Virtual Directory of ur Application >Go to Properties >Directory security TAB> On the Anonymouse Access and Auth control click EDIT and make sure u check Anonymous access! Also make sure u have :- <identity impersonate="true" /> placed in ur web.config Try all that! Let me know if it works for u..if not post ur Question. "Justin" wrote:
No, the user is not authenticated at all, meaning it goes to the else statement in the code below no matter what:
private void Login_Click(object sender, System.EventArgs e) { if (FormsAuthentication.Authenticate(Email.Text, Password.Text)) { FormsAuthentication.RedirectFromLoginPage(Email.Te xt, false); } else { lblStatus.Text = "Authentication Failed."; } } "Patrick.O.Ige" wrote:
> Hey Justin, > When u mean authorization do u mean th user can login but he is not > getting the appropriate resources? > That means is he authenticated? > > > > "Justin" wrote: > > > I am trying to password protect a subdirectory using forms authentication. I > > am using the "Location" tag to specify the directory to be protected. The > > login.aspx page is in the root directory of the app. Here is the web.config: > > > > <location path="Admin"> > > <system.web> > > <authentication mode="Forms"> > > <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> > > <credentials passwordFormat="Clear"> > > <user name="Admin" password="pass"/> > > <user name="Ashlyinn" password="pass"/> > > </credentials> > > </forms> > > </authentication> > > <authorization> > > <deny users="?"/> > > </authorization> > > </system.web> > > </location> > > > > The problem is event if I put in the proper valid credentials authorization > > fails. > > > > Any suggestions? > > > > Thanks, Justin.
This link shoud help for sure:- http://www.15seconds.com/issue/020220.htm
And by the way in ur Web.Config why don't u do:-
<configuration>
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms">
<forms name="appNameAuth" path="/" loginUrl="login.aspx"
protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="jeff" password="test" />
<user name="mike" password="test" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
And then if u want to perform Auhtorization use the location PATH and specify
whch users can see access contents of a particular FOLDER!
GDLUCK
"Patrick.O.Ige" wrote: Just try looking through ur code carefully ok!
Justin try looking through:-Forms Authentication here:- http://samples.gotdotnet.com/quickstart/aspplus/ or http://support.microsoft.com/default...301240&SD=MSDN or http://www.costudio.com/form_auth.asp
"Justin" wrote:
Well, unfortunetly it still does not work. I am sure its something simle but sometimes simple problems are hard to fix.
Thanks for the help.
Justin.
"Patrick.O.Ige" wrote:
Ok Justin so No authentication at al!! Are u sure u have all the right settings? First check to see whether u have Anonymous Auth checked in IIS. Got to ur WebServer and right click on ur Virtual Directory of ur Application >Go to Properties >Directory security TAB> On the Anonymouse Access and Auth control click EDIT and make sure u check Anonymous access! Also make sure u have :- <identity impersonate="true" /> placed in ur web.config Try all that! Let me know if it works for u..if not post ur Question. "Justin" wrote:
> No, the user is not authenticated at all, meaning it goes to the else > statement in the code below no matter what: > > private void Login_Click(object sender, System.EventArgs e) > { > if (FormsAuthentication.Authenticate(Email.Text, Password.Text)) > { > FormsAuthentication.RedirectFromLoginPage(Email.Te xt, false); > } > else > { > lblStatus.Text = "Authentication Failed."; > } > } > > > > "Patrick.O.Ige" wrote: > > > Hey Justin, > > When u mean authorization do u mean th user can login but he is not > > getting the appropriate resources? > > That means is he authenticated? > > > > > > > > "Justin" wrote: > > > > > I am trying to password protect a subdirectory using forms authentication. I > > > am using the "Location" tag to specify the directory to be protected. The > > > login.aspx page is in the root directory of the app. Here is the web.config: > > > > > > <location path="Admin"> > > > <system.web> > > > <authentication mode="Forms"> > > > <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> > > > <credentials passwordFormat="Clear"> > > > <user name="Admin" password="pass"/> > > > <user name="Ashlyinn" password="pass"/> > > > </credentials> > > > </forms> > > > </authentication> > > > <authorization> > > > <deny users="?"/> > > > </authorization> > > > </system.web> > > > </location> > > > > > > The problem is event if I put in the proper valid credentials authorization > > > fails. > > > > > > Any suggestions? > > > > > > Thanks, Justin.
Ok, I am getting closer to getting this to work the only problem is that
after loging in it redirects to default.aspx in the root directory instead of
admin/default.aspx.
How do I manualy set redirect url?
"Patrick.O.Ige" wrote: This link shoud help for sure:- http://www.15seconds.com/issue/020220.htm And by the way in ur Web.Config why don't u do:- <configuration> <system.web> <customErrors mode="Off"/> <authentication mode="Forms"> <forms name="appNameAuth" path="/" loginUrl="login.aspx" protection="All" timeout="30"> <credentials passwordFormat="Clear"> <user name="jeff" password="test" /> <user name="mike" password="test" /> </credentials> </forms> </authentication> <authorization> <deny users="?" /> </authorization> </system.web> </configuration>
And then if u want to perform Auhtorization use the location PATH and specify whch users can see access contents of a particular FOLDER! GDLUCK
"Patrick.O.Ige" wrote:
Just try looking through ur code carefully ok!
Justin try looking through:-Forms Authentication here:- http://samples.gotdotnet.com/quickstart/aspplus/ or http://support.microsoft.com/default...301240&SD=MSDN or http://www.costudio.com/form_auth.asp
"Justin" wrote:
Well, unfortunetly it still does not work. I am sure its something simle but sometimes simple problems are hard to fix.
Thanks for the help.
Justin.
"Patrick.O.Ige" wrote:
> Ok Justin so No authentication at al!! > Are u sure u have all the right settings? > First check to see whether u have Anonymous Auth checked in IIS. > Got to ur WebServer and right click on ur Virtual Directory of ur > Application >Go to Properties >Directory security TAB> On the Anonymouse > Access and Auth control > click EDIT and make sure u check Anonymous access! > Also make sure u have :- <identity impersonate="true" /> placed in ur > web.config > Try all that! > Let me know if it works for u..if not post ur Question. > > > > "Justin" wrote: > > > No, the user is not authenticated at all, meaning it goes to the else > > statement in the code below no matter what: > > > > private void Login_Click(object sender, System.EventArgs e) > > { > > if (FormsAuthentication.Authenticate(Email.Text, Password.Text)) > > { > > FormsAuthentication.RedirectFromLoginPage(Email.Te xt, false); > > } > > else > > { > > lblStatus.Text = "Authentication Failed."; > > } > > } > > > > > > > > "Patrick.O.Ige" wrote: > > > > > Hey Justin, > > > When u mean authorization do u mean th user can login but he is not > > > getting the appropriate resources? > > > That means is he authenticated? > > > > > > > > > > > > "Justin" wrote: > > > > > > > I am trying to password protect a subdirectory using forms authentication. I > > > > am using the "Location" tag to specify the directory to be protected. The > > > > login.aspx page is in the root directory of the app. Here is the web.config: > > > > > > > > <location path="Admin"> > > > > <system.web> > > > > <authentication mode="Forms"> > > > > <forms name="authAdmin" loginUrl="Login.aspx" protection="All" timeout="30"> > > > > <credentials passwordFormat="Clear"> > > > > <user name="Admin" password="pass"/> > > > > <user name="Ashlyinn" password="pass"/> > > > > </credentials> > > > > </forms> > > > > </authentication> > > > > <authorization> > > > > <deny users="?"/> > > > > </authorization> > > > > </system.web> > > > > </location> > > > > > > > > The problem is event if I put in the proper valid credentials authorization > > > > fails. > > > > > > > > Any suggestions? > > > > > > > > Thanks, Justin. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Billy Jacobs |
last post by:
I have a website which has both secure and non-secure
pages. I want to uses forms authentication. How do I
accomplish this?
Originally I had my web.config file in the root with Forms...
|
by: Kris van der Mast |
last post by:
Hi,
I've created a little site for my sports club. In the root folder there are
pages that are viewable by every anonymous user but at a certain subfolder
my administration pages should be...
|
by: Daniel Walzenbach |
last post by:
Hi,
I have an application using "Forms authentication".
Everything works perfectly well except when I try to open
a new page with java script like the following:
<script...
|
by: Anonieko Ramos |
last post by:
ASP.NET Forms Authentication Best Practices
Dr. Dobb's Journal February 2004
Protecting user information is critical
By Douglas Reilly
Douglas is the author of Designing Microsoft ASP.NET...
|
by: V. Jenks |
last post by:
Using forms authentication, can I control which pages
and/or directories a user would have access to or is that
only available with Windows authentication?
Thanks!
|
by: chris.rust |
last post by:
Has anyone else had any trouble setting up a sitemap view to be
filtered by roles?
We've put a cust role provider in place, and we can verify that it's
only being called once for each...
|
by: =?Utf-8?B?R3V1czEyMw==?= |
last post by:
Hi,
I created a web site on a remote server. To logon the user must enter a user
id and password. The site is uses Forms Authentication.
The web config file looks as follows:
...
|
by: Bjorn Sagbakken |
last post by:
In a web-application with login creds (user, pwd), these are checked against
a user table on a SQL server. On a positive validation I have saved the
userID, name, custno and role-settings in a...
|
by: Rory Becker |
last post by:
Having now created a Custom MembershipProvider that seems to work correctly
with my Logon and ChangePassword controls, I am, as they say, a happy bunny.
The next stange is to move on to the...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |