Good morning, Paul. Glad to know someone else works on Sunday morning.
Here's the authentication section of web.config:
........
<authenticati on mode="Forms">
<forms name="AuthCooki e" loginUrl="Login Page.aspx">
<credentials passwordFormat= "Clear">
<user name="Tom" password="tucke r" />
<user name="TomReal" password="tucke rreal" />
</credentials>
</forms>
</authentication>
........
Configuration section is:
...........
<configuratio n>
<location path="SecuredPa ge.aspx">
<system.web>
<authorizatio n>
<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 (FormsAuthentic ation.Authentic ate(txtUserName .Text,
txtPassword.Tex t)) then FormsAuthentica tion.SetAuthCoo kie(txtUserName .Text,
false)
Select Case txtUsername.Tex t
Case "Tom"
Response.Redire ct ("SecuredPage.a spx")
Case Else Label4.Text = "Please contact Support. User "
& txtUserName.Tex t & " 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_<RealMachi neName>, IIS
controls password. Also set to Integrated Windows authentication.
Documents: Default documents set to (Default.htm,de fault.asp,
index.htm,iisst art.asp). I don't have any of those docs in the application.
My login page is loginpage.aspx, my application page is SecuredPage.asp x.
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**@aspallian ce.com-NOSPAM> wrote in
message news:%2******** **********@TK2M SFTNGP09.phx.gb l...
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*****@hotmai l.com> wrote in message
news:8L******** **********@news read2.news.atl. earthlink.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://<RealMachineNam e>/testapp/login.aspx, I get
the login page, but after logging in, I stay on the login page. The URL
address shows
http://<RealMachineNam e>/testapp/LoginPage.aspx? ReturnUrl=%2fte stapp%2fSecured Page.aspx.
Can anyone tell me what I need to change here? Thanks.