Net Code Monkey
Code for the primates

.Net 2.0 SP1 logon error... Updated

April 14, 2008 01:46 by Jay McNeely

Anyone else having an error on forms authenticated .Net 2.0 forms today.  Seems like SP1 changed the ReturnUrl.  I will post a fix when i find it.

Error:

Server Error in '/' Application.


Access is denied.

Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration.  Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server.  Contact the Web server's administrator for additional assistance.


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

 

Love to see the red / of death!!

 

So here is the deal.  .Net 2.0 Service Pack 1 won't let you redirect twice.  i.e. if you have a default page, and a logon page.  You only want to allow https connections and all unauthorized traffic needs to get sent to logon.aspx.  A new user gets sent to default.aspx... which routes them to logon.aspx because of your web.config settings.  It hits logon, and you check logon to see if the user is over ssl.  if not you redirect them to https... 

in .net 2.0 you don't need to specify https://domain/login.aspx.  you just need to specify https://domain/... It sees the user is still not authorized and sends them to logon. 

in Service Pack 1... not so much.  You get a windows logon window when you hit https://domain/?redirectinfo

 

Hence the bug...  just changing the code to hit https://domain/login.aspx fixes this issue....  Welcome to Monday!

 

-Jay

del.icio.us Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Code
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

November 19. 2008 09:43