473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FormsAuthentica tion - <http://localhost> Works, <http://RealMachineName > Does Not

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.


Nov 18 '05 #1
3 2559
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.


Nov 18 '05 #2
The response you are getting from the "real" machine looks like what you
should get if you went to:
http://<RealMachineNam e>/testapp/SecuredPage.asp x instead of the login page.
In that case, after authentication, you would use .redirectfromlo ginpage to
return to it.

"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.

Nov 18 '05 #3
I'll try that, Rick. Thanks.

"Rick Spiewak" <ri*********@mi ndspring.com> wrote in message
news:OB******** ******@TK2MSFTN GP09.phx.gbl...
The response you are getting from the "real" machine looks like what you
should get if you went to:
http://<RealMachineNam e>/testapp/SecuredPage.asp x instead of the login page. In that case, after authentication, you would use .redirectfromlo ginpage to return to it.

"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.


Nov 18 '05 #4

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

Similar topics

11
13687
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> <H1>Hello World!</H1> <P>More stuff here...</P>
19
1911
by: Kim André Akerĝ | last post by:
For some reason, I can't get the middle column of this setup to work properly in IE (go figure). It looks like it's supposed to in Opera and Firefox, but now I only need it to work in IE as well. I've checked around Google for possible clues, some having a JavaScript solution to something I believe should be possible to fix in pure CSS. In fact, that's exactly what I need; a pure XHTML/CSS solution (no client-side scripting). Can...
3
3067
by: Jacob Crossley | last post by:
I have two web applications on the same server: http://localhost/ModemUpgrade and http://localhost/TestFormAuth The web.config of ModemUpgrade:
5
3579
by: Jeff Johnson | last post by:
I'm using forms authentication to protect a subfolder within my site. I've got it working fine except for two issues: (1) When I do a RedirectFromLogin page I have to put a cookie path ("/" works, or "/mysubdir") or else the auth cookie doesn't get set. I'd like to know why this is necessary. (2) When I call SignOut() the auth cookie is not removed, no matter what I try (no how the cookie is set in the RedirectFromLogin page.
21
8522
by: hemant.singh | last post by:
Hello all, I am try'g to send window.location.href to the server script who will generate dynamic javascript according to the referral name comg in as param Now bcz <script language="javascript" src="NO JAVASCRIPT CAN BE USED HERE" /> So I am see'g If I can use eval todo something what I am doing I have tried almost everything, following is being last one
8
3527
by: chris_fieldhouse | last post by:
Hi fairly new to php, but picking it up quite well. the question I have, is it possible for a php script which is used to validate values submitted in a form, to then post these values onto another script/page or even back to the calling form? i.e. the application I have in question is a login.htm page with a verify.php script The login.htm has a Form which captures login_id and password which are posted to verify.php
8
4012
by: michael | last post by:
Hi all A client of mine is having a problem with their site and when I looked into the SQL database, I found that most text fields have been altered and appended with script src=http://www.westpacsecuresite.com/b.js/script I've taken out the < so that this shows.
6
3106
by: Guy Macon | last post by:
While I agree with the sentiment, the oringinal title on this thread ("OT: Specially for , why you should always use example.com for obfuscating domains") is wrong. There are other reserved domain names besides example.com. The search for reserved domain names should start with RFC 2606 ( http://www.faqs.org/rfcs/rfc2606.html ) which defines; *.test *.example
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.