Ask a Question related to ASP.NET Security, Design and Development.
-
RC #1
Stupid Forms Auth Question
I'm new... please be gentle...
I've built a login form for a very simple website using C#/ASP.NET.
Security isn't that big of a deal, so I'm storing my passwords in clear
text in web.config. Here's my web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<authentication mode="Forms">
<forms name="testcookie" loginUrl="/default.aspx">
<credentials passwordFormat="Clear">
<user name="username" password="password"/>
</credentials>
</forms>
</authentication>
</system.web>
</configuration>
And here's the problem - I can bypass the login screen and get to other
pages that should be protected. For example, when the credentials are
validated, the user is redirected to members.aspx (in the same
directory). But right now, I can access members.aspx without ever
logging in.
Is the cookie not being created? Is a session not being created? How
do I set up protected vs. non-protected pages (I don't want it to be
either/or - I would like some pages open to everyone and others open
only to a select few)? I'm so anxious to get off the ground, and I was
wondering if you could spare a minute to help?
RC Guest
-
Forms Auth Info passed to Windows Auth?
The requirement is to build an ASP.Net intranet application, so external users can log in to the main web portal via forms authentication, using... -
Forms Auth cookie question
This may be a dumb question, but does anyone know where the Forms Authentication cookie is kept on an XP box? It definitely isn't kept with all of... -
Forms Auth and FormsAuthentication.SignOut()Question
I'm using Form Auth. I 'm using the FormsAuthentication.SignOut() to sign out But when the user logins in and later logs out using... -
Forms Auth with ADirectory Question
I tried out the code at:- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetse c/html/SecNetHT02.asp But i'm getting the... -
Forms Auth Redirect on Access Denied - Question/Help
If a web app uses forms authentication and a specific aspx page has a role authorization, where should a browser be directed if a user is not in... -
Svein Terje Gaup #2
Re: Stupid Forms Auth Question
You seem to have forgotten to put in the "authorization" section of the
web.config file.
It should look somewhat like this:
<authorization>
<deny users="?" />
</authorization>
Take a look at this article for a nice QuickStart:
[url]http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx[/url]
Sincerely
Svein Terje Gaup
"RC" <nainlbb@yahoo.com> wrote in message
news:110igh6hu3bt6f8@corp.supernews.com...> I'm new... please be gentle...
>
> I've built a login form for a very simple website using C#/ASP.NET.
> Security isn't that big of a deal, so I'm storing my passwords in clear
> text in web.config. Here's my web.config:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <system.web>
> <compilation defaultLanguage="c#" debug="true" />
> <authentication mode="Forms">
> <forms name="testcookie" loginUrl="/default.aspx">
> <credentials passwordFormat="Clear">
> <user name="username" password="password"/>
> </credentials>
> </forms>
> </authentication>
> </system.web>
> </configuration>
>
> And here's the problem - I can bypass the login screen and get to other
> pages that should be protected. For example, when the credentials are
> validated, the user is redirected to members.aspx (in the same directory).
> But right now, I can access members.aspx without ever logging in.
>
> Is the cookie not being created? Is a session not being created? How do
> I set up protected vs. non-protected pages (I don't want it to be
> either/or - I would like some pages open to everyone and others open only
> to a select few)? I'm so anxious to get off the ground, and I was
> wondering if you could spare a minute to help?
Svein Terje Gaup Guest
-
RC #3
Re: Stupid Forms Auth Question
Thanks for the help. That did the trick.
I guess if I could differentiate protected/non-protected content by
using a separate folder with a separate web.config file. Feasible? Is
there a better way?
I'm fixing to read the link you sent me. Thank you.
> You seem to have forgotten to put in the "authorization" section of the
> web.config file.
>
> It should look somewhat like this:
> <authorization>
> <deny users="?" />
> </authorization>
>
> Take a look at this article for a nice QuickStart:
> [url]http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx[/url]RC Guest
-
Andy G #4
Re: Stupid Forms Auth Question
This is what to do to unprotect one specific page or directory....I inserted
how to do this inside what you posted earlier. You use the <location> tag.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="c#" debug="true" />
<authentication mode="Forms">
<forms name="testcookie" loginUrl="/default.aspx">
<credentials passwordFormat="Clear">
<user name="username" password="password"/>
</credentials>
</forms>
</authentication>
</system.web>
<location path="Project1/unprotect.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>
"RC" <nainlbb@yahoo.com> wrote in message
news:110iin34jruese4@corp.supernews.com...> Thanks for the help. That did the trick.
>
> I guess if I could differentiate protected/non-protected content by
> using a separate folder with a separate web.config file. Feasible? Is
> there a better way?
>
> I'm fixing to read the link you sent me. Thank you.
>> > You seem to have forgotten to put in the "authorization" section of the
> > web.config file.
> >
> > It should look somewhat like this:
> > <authorization>
> > <deny users="?" />
> > </authorization>
> >
> > Take a look at this article for a nice QuickStart:
> > [url]http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx[/url]
Andy G Guest



Reply With Quote

