Good morning, Paul. Glad to know someone else works on Sunday morning.
Here's the authentication section of web.config:
........
<authentication mode="Forms">
<forms name="AuthCookie" loginUrl="LoginPage.aspx">
<credentials passwordFormat="Clear">
<user name="Tom" password="tucker" />
<user name="TomReal" password="tuckerreal" />
</credentials>
</forms>
</authentication>
........
Configuration section is:
...........
<configuration>
<location path="SecuredPage.aspx">
<system.web>
<authorization>
<allow users="Tom"/>
<deny users="?"/>
</authorization>
</system.web>
</location>
..........
Here's the code from the login page:
......................
Sub Login(obj as object, e as eventargs)
If (FormsAuthentication.Authenticate(txtUserName.Text ,
txtPassword.Text)) then FormsAuthentication.SetAuthCookie(txtUserName.Text ,
false)
Select Case txtUsername.Text
Case "Tom"
Response.Redirect ("SecuredPage.aspx")
Case Else Label4.Text = "Please contact Support. User "
& txtUserName.Text & " is not recognized."
End Select
Else
Label4.Text = "Sorry, invalid user name or password."
End If
End Sub
.....................
The IIS config for the site is:
Directory Security: Anonymous access set to IUSR_<RealMachineName>, IIS
controls password. Also set to Integrated Windows authentication.
Documents: Default documents set to (Default.htm,default.asp,
index.htm,iisstart.asp). I don't have any of those docs in the application.
My login page is loginpage.aspx, my application page is SecuredPage.aspx.
App permissions are set to: Read, Write, log visits.
Application settings are: Application name: TestApp
Execute permissions: Scripts only
Application Protection: Medium(pooled).
Let me know if there's another information that would be helpful.
Thanks for your help.
"Paul Glavich [MVP - ASP.NET]" <gl**@aspalliance.com-NOSPAM> wrote in
message news:%2******************@TK2MSFTNGP09.phx.gbl...
Need a bit mnore information on how yu have things setup. Can you provide
details on the contents of the autentication element in your web.config,
as well as the IIS configuration for your *deployed* web site.
--
- Paul Glavich
Microsoft MVP - ASP.NET
"T. Regan" <tj*****@hotmail.com> wrote in message
news:8L******************@newsread2.news.atl.earth link.net... I have a test app where I have Forms Authentication set up.
When I build and run the app as http://localhost/testapp/login.aspx, it
runs correctly. I get the login prompt and the proper redirection to the
secured page.
When I run the app as http://<RealMachineName>/testapp/login.aspx, I get
the login page, but after logging in, I stay on the login page. The URL
address shows
http://<RealMachineName>/testapp/LoginPage.aspx?ReturnUrl=%2ftestapp%2fSecuredPage. aspx.
Can anyone tell me what I need to change here? Thanks.