473,396 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

question about login and roles

Ben
Hi,
I defined roles in order to deny access for some pages to anonymous users.
I tested it by typing the url of a denied page to test the system
(http://denypage.aspx).

It works (access denied), and i'm automatically redirected to the login.aspx
file that is defined in the root of the application.

Now i wonder how asp.net knows where the file containing the login control
is. I tried this:
- changing the location of file login.aspx (putting it into a subdir)
- changing the name of login.aspx to login2.aspx

In both cases, when trying to access a denied file, i get the error:"The
resource cannot be found: /app_name/login.aspx .

May i conclude that file "login.aspx" always MUST be in the root of the
application and that its name MUST be 'login.aspx'?

Thanks
Mar 12 '07 #1
4 1333
I take you you're using Forms Authentication. In which case, you will have
something like this in your Web.config file:

<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="adAuthCookie" timeout="10" path="/">
</forms>
</authentication>

It is the name in the <formselement LoginUrl attribute that determines
where the user is redirected (if I understand correctly).

HTH
Peter

"Ben" <bn*@mail.dewrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
Hi,
I defined roles in order to deny access for some pages to anonymous users.
I tested it by typing the url of a denied page to test the system
(http://denypage.aspx).

It works (access denied), and i'm automatically redirected to the
login.aspx file that is defined in the root of the application.

Now i wonder how asp.net knows where the file containing the login control
is. I tried this:
- changing the location of file login.aspx (putting it into a subdir)
- changing the name of login.aspx to login2.aspx

In both cases, when trying to access a denied file, i get the error:"The
resource cannot be found: /app_name/login.aspx .

May i conclude that file "login.aspx" always MUST be in the root of the
application and that its name MUST be 'login.aspx'?

Thanks

Mar 12 '07 #2
Ben
Hi, thanks for replying.
All i have about authentification in web.config is:

<authentication mode="Forms"/>
Maybe are in that case (when nothing is specified) the default values for
the location the root and for the name of the file 'login.aspx'?
"Peter Bradley" <pb******@uwic.ac.ukschreef in bericht
news:u0**************@TK2MSFTNGP03.phx.gbl...
>I take you you're using Forms Authentication. In which case, you will have
something like this in your Web.config file:

<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="adAuthCookie" timeout="10" path="/">
</forms>
</authentication>

It is the name in the <formselement LoginUrl attribute that determines
where the user is redirected (if I understand correctly).

HTH
Peter

"Ben" <bn*@mail.dewrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>Hi,
I defined roles in order to deny access for some pages to anonymous
users.
I tested it by typing the url of a denied page to test the system
(http://denypage.aspx).

It works (access denied), and i'm automatically redirected to the
login.aspx file that is defined in the root of the application.

Now i wonder how asp.net knows where the file containing the login
control is. I tried this:
- changing the location of file login.aspx (putting it into a subdir)
- changing the name of login.aspx to login2.aspx

In both cases, when trying to access a denied file, i get the error:"The
resource cannot be found: /app_name/login.aspx .

May i conclude that file "login.aspx" always MUST be in the root of the
application and that its name MUST be 'login.aspx'?

Thanks


Mar 12 '07 #3
yep "~/login.aspx" is the default value...
-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
Hi, thanks for replying.
All i have about authentification in web.config is:
<authentication mode="Forms"/>
Maybe are in that case (when nothing is specified) the default values
for
the location the root and for the name of the file 'login.aspx'?
"Peter Bradley" <pb******@uwic.ac.ukschreef in bericht
news:u0**************@TK2MSFTNGP03.phx.gbl...
>I take you you're using Forms Authentication. In which case, you
will have something like this in your Web.config file:

<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="adAuthCookie" timeout="10"
path="/">
</forms>
</authentication>
It is the name in the <formselement LoginUrl attribute that
determines where the user is redirected (if I understand correctly).

HTH

Peter

"Ben" <bn*@mail.dewrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...
>>Hi,

I defined roles in order to deny access for some pages to anonymous
users.
I tested it by typing the url of a denied page to test the system
(http://denypage.aspx).
It works (access denied), and i'm automatically redirected to the
login.aspx file that is defined in the root of the application.

Now i wonder how asp.net knows where the file containing the login
control is. I tried this:
- changing the location of file login.aspx (putting it into a
subdir)
- changing the name of login.aspx to login2.aspx
In both cases, when trying to access a denied file, i get the
error:"The resource cannot be found: /app_name/login.aspx .

May i conclude that file "login.aspx" always MUST be in the root of
the application and that its name MUST be 'login.aspx'?

Thanks

Mar 12 '07 #4
Ben
thanks

"Dominick Baier" <dbaier@pleasepleasenospam_leastprivilege.comschre ef in
bericht news:51*************************@news.microsoft.co m...
yep "~/login.aspx" is the default value...
-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications
(http://www.microsoft.com/mspress/books/9989.asp)
>Hi, thanks for replying.
All i have about authentification in web.config is:
<authentication mode="Forms"/>
Maybe are in that case (when nothing is specified) the default values
for
the location the root and for the name of the file 'login.aspx'?
"Peter Bradley" <pb******@uwic.ac.ukschreef in bericht
news:u0**************@TK2MSFTNGP03.phx.gbl...
>>I take you you're using Forms Authentication. In which case, you
will have something like this in your Web.config file:

<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="adAuthCookie" timeout="10"
path="/">
</forms>
</authentication>
It is the name in the <formselement LoginUrl attribute that
determines where the user is redirected (if I understand correctly).

HTH

Peter

"Ben" <bn*@mail.dewrote in message
news:u7**************@TK2MSFTNGP03.phx.gbl...

Hi,

I defined roles in order to deny access for some pages to anonymous
users.
I tested it by typing the url of a denied page to test the system
(http://denypage.aspx).
It works (access denied), and i'm automatically redirected to the
login.aspx file that is defined in the root of the application.

Now i wonder how asp.net knows where the file containing the login
control is. I tried this:
- changing the location of file login.aspx (putting it into a
subdir)
- changing the name of login.aspx to login2.aspx
In both cases, when trying to access a denied file, i get the
error:"The resource cannot be found: /app_name/login.aspx .

May i conclude that file "login.aspx" always MUST be in the root of
the application and that its name MUST be 'login.aspx'?

Thanks


Mar 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: teddysnips | last post by:
Currently studying for 70-229. I'm trying to understand how security for users is managed in SQL Server. I've been using SQL Server for a few years now, but without investigating the bits that...
1
by: Homa | last post by:
Hi, I am using a role-based Forms Authentication. I have several directories that have different levels of authorization. When I try to access another directory, the page bounce me back to the...
4
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for...
5
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!
2
by: Frank Bishop | last post by:
I'm using forms authentication with a database. I have an app that lets users run online reports. Right now, depending on their login in the DB, they get redirected to the pages that apply to...
1
by: Alex Nitulescu | last post by:
Hi. I have two questions, please: a) If I go DIRECTLY to Login, there's no Request.Params("ReturnURL"), and therefore RedirectFromLogin won't work, because it will try to go to a page named...
10
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login...
1
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database -...
0
by: sandari | last post by:
The following code (web.config in Visual Studio 2005) is supposed to redirect a user to the appropriate Form depending on their role. However, regardless of the user's role, the only page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.