Jump to content
Xtreme .Net Talk

How can I have Forms based auth and Basic Auth on same server?


Recommended Posts

Posted

Hello, I am developing this website to have 2 ways to login.

 

The first way is a normal Forms based login.

 

And the 2nd way is Basic Authentication... I have a subdir and file that a user goes to.. lets say /subdir/login.html. And once the user enters in his credentials, I want him to be redirected to /mainpage.html

 

I am using this code for both logins:

                       FormsAuthentication.RedirectFromLoginPage("CookieMonster", False)
                       httpApplication.Response.Redirect("/mainpage.html")

 

But, after the user authenticates via basic authentication, he is redirected to the /mainpage.html and for some reason then redirected to the forms based authentication menu.

 

Why is this?

 

And how can I fix it?

 

 

thanks Lee

Posted

Well.. can you have authentication on a subdir and it allow the user to be authenticated on the root dir?

 

Example:

 

user authenticates at /subdir/login.aspx

and then it redirects him to /main.aspx

 

 

(if the user doesn't authenticate via /subdir/login.aspx and tries to go to /main.aspx, he will be outputed at /login.aspx )

 

 

thanks

Lee

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...