Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Forms Authentication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Guus123 - 10 Dec 2007 20:25 GMT
Hi,

I created a web site on a remote server. To logon the user must enter a user
id and password. The site is uses Forms Authentication.

The web config file looks as follows:

<configuration>
   <system.web>
       <customErrors mode="Off"/>
       <authentication mode="Forms">
           <forms loginUrl="login.aspx" protection="All">
               <credentials passwordFormat="Clear">
               </credentials>
           </forms>
       </authentication>
       <authorization>
           <deny users="?" />
       </authorization>
   </system.web>
</configuration>

I my code behind on the login.aspx I have

If FormsAuthentication.Authenticate(txtUser.Text, txtPassword.Text) Then
    FormsAuthentication.RedirectFromLoginPage(txtUser.Text, true)
Response.Redirect("somesample.aspx")
 End If

This works fine when I go the site via IE using the IP address. I just
recently connected a domain name "www.somename.com" to it using a DNS
service. When I use the domain name in the URL. My logon form never redirects
but always keeps on the logon page. Can anyone help me?

Signature

FC Utrecht are Champions!

Steven Cheng[MSFT] - 11 Dec 2007 07:48 GMT
Hi Guus123,

From your description, you have an ASP.NET application that uses forms
authentication. It works well in dev env, but after deployed to server and
visisted through public DNS server address, the forms authenticcation no
longer work, correct?

Based on my experience, such problem behavior is possibly caused by the
authentication ticket(cookie based) is not correctly set to the domain your
client browser belong to.    

for ASP.NET forms authentication, if you choose to persist authentication
status, it will generate an authentication ticket and store it in cookie,
however, for cookie, it has a "domain" property indicate which domain it
belong. For your scenario, I think it is likely that the default domain
setting doesn't quite fit your environment. Here is a web article discuss
something on this issue:

#Forms Authentication Cookies and Subdomain Names
http://blog-howto.com/archive/2006/09/21/FormsAuthCookiesAndSubdomainNames.a
spx

You can have a look to see whether it helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
   

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?R3V1czEyMw==?= <Guus123@newsgroup.nospam>
>Subject: Forms Authentication
>Date: Mon, 10 Dec 2007 12:25:04 -0800

>Hi,
>
[quoted text clipped - 29 lines]
>service. When I use the domain name in the URL. My logon form never redirects
>but always keeps on the logon page. Can anyone help me?
Guus123 - 11 Dec 2007 09:14 GMT
Hi,

Thanks for your information. I read the article of the link you gave me. I
did try to access my web site using the domain name from a machine that has
never been to the site not even using the IP address and still could not
logon and still had the same problem. This should have overcome the cookie
problem, or is my thinking incorrect?
Signature

FC Utrecht are Champions!

> Hi Guus123,
>
[quoted text clipped - 93 lines]
> redirects
> >but always keeps on the logon page. Can anyone help me?
Guus123 - 13 Dec 2007 07:20 GMT
Hi,

Ok, I found the problem. The DNS entry for my domain was not set corrretly,
which was stuffing up my cookies with a incorrect domain. All working now
thanks.
Signature

FC Utrecht are Champions!

> Hi,
>
[quoted text clipped - 101 lines]
> > redirects
> > >but always keeps on the logon page. Can anyone help me?
Steven Cheng[MSFT] - 13 Dec 2007 09:26 GMT
Thanks for your reply  Guus,

Glad that you've figured it out. I've justed performed some further
research but didn't find any other well-known issue. Seems the DNS has made
a joke with us here:)

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

-------------------
>From: =?Utf-8?B?R3V1czEyMw==?= <Guus123@newsgroup.nospam>
>Subject: RE: Forms Authentication
>Date: Wed, 12 Dec 2007 23:20:00 -0800

>Hi,
>
[quoted text clipped - 29 lines]
>> >
>> > #Forms Authentication Cookies and Subdomain Names

http://blog-howto.com/archive/2006/09/21/FormsAuthCookiesAndSubdomainNames.a
>> > spx
>> >
[quoted text clipped - 11 lines]
>> >
>> > Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> > ications.
>> >
[quoted text clipped - 57 lines]
>> > redirects
>> > >but always keeps on the logon page. Can anyone help me?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.