Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET 1.0
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 29th, 2004, 12:34 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 20 basic authentication

I worked through the example in Chapter 20 and am having some issues.

1. Is BASIC (virtual folder) supposed to point to: c:\begaspnet\ch20\basic? If I right click that folder (c:\begaspnet\ch20\basic), and pick New virtual directory, and select the folder, when I attempt to visit that page, I get an error:

http://nrbitappw08p4/BegASPNET/ch20/basic/
(url as seen on page 737)
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.


If I attempt to goto: http://nrbitappw08p4/basic, I get:
HTTP 404 - File not found
Internet Information Services


2. So I recreate the Virtual Directory, BASIC, from the Default Web Site to point to the same location. It now appears at the same level as the BegASPNET virtual folder.

BegASPNET allows anonymous access, but this folder underneath it, with a web.config uses Basic Authentication. I attempt to access it and am not prompted to enter any credentials either accessing it remotely or locally. Why?


3. I changed the web.config file to add an <authorization> section. When I did this, it began prompting me. HOWEVER, after taking it out, and "bouncing" IIS, it is still prompting, which is wasn't doing at Step#2 just minutes before. What gives?

  #2 (permalink)  
Old June 29th, 2004, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

If your virtual allows anonymous access, it runs as the the user setup for the anonymous access IUSR_MachineName. To make the user login to your application, you must enter:

<deny users="?"/> - Deny anonymous users
<allow users="*"/> - Allow logged in users

That is for forms-based auth, which is that what you are doing?

Brian
  #3 (permalink)  
Old June 29th, 2004, 02:57 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In this case, I was only using BASIC Authentication. So I couldn't figure out why I was never prompted for a login. The default.aspx page would show up and both the User.Identity.Name and User.Identity.AuthenticationType were blank. However, since then I have not been able to reproduce the error.

Getting back to the virtual folders, in the text, the book's example screenshot shows a URL of:
http://localhost/BegASPNET/Ch20/Basic/

If I attempt to navigate to that folder then I get the error above. If I create the Virtual Folder the way I would expect to create it (at the same level as BegASPNET and navigate to the site as http://localhost/Basic/, then things work fine.

I guess I'm wondering if I'm doing things correctly because every example shows a URL that includes http://localhost/BegASPNET/ch20/ in it, and these don't work at all for me.

  #4 (permalink)  
Old June 29th, 2004, 09:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

Well, ASP.NET works with virtuals, and I'm guessing that many layers is throwing it off. You may be able to (at the first folder path 3 levels deep) if you go to the Basic folder, right click it, and under properties\Virtual Directory, make sure where it says Application Name, make sure the button to the right says remove. If it says create, click it to create the app.

Try that,

Brian
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic authentication KamalRaturi ASP.NET 2.0 Professional 2 July 17th, 2007 07:04 AM
ASP.NET 1.0 Chapter 20 Custom Authentication and . rjwelte .NET Web Services 0 September 2nd, 2004 07:31 PM
Chapter 20 masegui JSP Basics 0 April 1st, 2004 07:54 AM
Chapter 20 -Forms based Authentication bshay BOOK: Beginning ASP.NET 1.0 2 October 7th, 2003 09:17 AM



All times are GMT -4. The time now is 12:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.