Get authenticated user from ASP.NET in ASP classic - asp.net

I have a lot of ASP.NET 2.0 applications using the form authentication. It works well but now I need to integrate this in one of our old ASP classic application. I've checked this Scott Gu blog entry (http://weblogs.asp.net/scottgu/archive/2007/03/04/tip-trick-integrating-asp-net-security-with-classic-asp-and-non-asp-net-urls.aspx) and I follow the instruction but it doesn't work for me. When I check the AUTH_USER server variable in my asp.net page, it contains the same user name as User.Identity.Name but the same server variable is empty when I return to my ASP classic page. All pages are in the same virtual directory on IIS 6.0.
Thanks for your help.

I've figured out what was missing (the wildcard configuration). With that set properly, it works.

Related

Is it possible to use same authentication on classic asp and asp.net 4.5 on IIS7

I am trying to apply single sign-on to legacy classic asp applications and asp.net applications. I have created a asp.net login page for all aplications. I can successfully pass the authentication ticket from new login page to the old asp.net application and share the session using sql server. However, I cannot do the same thing for class asp applications. Even though I have logged in to the new asp login page, it still redirects me to the new login page when I go to the classic asp applications. I have already checked that their machine keys are the same. The classic asp applications are some .asp pages and html files without web.config before. I added the web.config file to the folder by myself. I can see the machine key in the IIS manger so I think it is reading the file.
Classic ASP and ASP.Net use a different session state object, therefor you're not logged in into your classic ASP site.
There is a possibility, it's kind of a hack. I used it once and it works pretty well. Please have a look at this blogpost to see if it fulfills your needs. It uses the ASP session cookies from .Net in asp classic to call a .Net page that returns session (login) data:
http://devproconnections.com/aspnet/share-session-state-between-asp-and-aspnet-apps

AUTH_USER, Claims, and Classic ASP

I am attempting to implement a claims based solution into an application. I have an MVC/Classic ASP application, as well as an STS. After authenticating with the STS, I can see the AUTH_USER server variable from my MVC pages. However, this (as well as AUTH_TYPE, LOGON_USER, etc) are not visible in my Classic ASP pages. I would like to be able to test against a server variable that a user is in fact authenticated on the server. If possible, I could read the claim created by the STS to validate the user with my classic ASP pages (not sure if that's an option)
Basically I need a way for my classic asp pages to know that the user is valid when I am logging in via an STS.
Thanks!

Session transfer between asp.net and asp works in soome cases and in some cases not

I transfer session from asp.net to classic asp.
I use MSSQL DB for it.
I have
SomeWebPage.aspx - this page is asp.net which save sesion, after it, it call by redirect
SessionTransfer.aspx -this page save sessions to DB and call by redirect
SessionTransfer.asp - this page load session from DB and cal by redirect
SomeWebPage.asp - this page doesn't need now about other pages, it just use session.
Problem is, that it works only if SomeWebPage.aspx, SessionTransfer.aspx, SessionTransfer.asp and SomeWebPage.asp are in same folder, or in same "web pages" folder on iis.
How can i do it if SomeWebPage.asp will be in other web folder. On same IIS server, but it will be specific web?
I use IIS 5.1 for developing and finished program will run on IIS 6.0.
Problem was that it was different applications.
SessionTransfer.asp must be it same application like SomeWebPage.asp (it wasn't)
and
SessionTransfer.aspx must be it same application (pool) like SomeWebPage.aspx (it was)
It ws teddy-bear problem. When we start discus about this, i realized where is problem :-D
thanks amit_g

IIS 5 & ASP.NET MVC Directory Browsing Problem

We configured IIS 5 by mappping * to asp.net handler so that ASP.NET MVC works. After configuring this, directory browsing is not working.
Also uploadify jquery plugin is not working. Showing IO error 2038.
Can someone please suggest us how to enable directory browsig with ASP.NET MVC configurations on IIS 5?
I don't think that you'll be able to get directory browsing to work with ASP.NET MVC in the same application. When you added the wildcard mapping, you told ASP to handle every request. If the request doesn't map to an actual file, it will try to match a route in MVC. If there isn't a matching controller with an index (assuming that's your default) action, then it will fail.
My suggestion is to split your web site into "application" and "content". Set up the application as a separate web site and apply the wildcard mapping there. Leave your content with the original configuration. I don't use IIS5 any more -- with one exception on an old XP development box -- I'm afraid that can't really be of more help.
If I were you, though, I'd upgrade to a more recent OS and web server. Expecting new technology to work on a decade-old platform is very optimistic.

Why can I not get application object in classic ASP when I add a .NET Wildcard mapping to directory?

We're migrating a site from classic asp to .NET. In the process, I need to use .NET authentication to secure the classic asp pages. This works great with wildcard mapping...unless the classic asp pages try to use something like the Application object.
I have tried adding an HTTPHandler to pass the request to the asp.dll, but to no avail.
Is what I am trying to do even possible?
Are you trying to have some of your old 'classic' asp pages within the same site as the .aspx pages? We've done something similar here, but we wound up with two websites, one for the asp and one for the .net and did some session sharing to perform the authentication.
It is possible on IIS7 using the integrated pipeline, I would say it would be highly fragile on IIS6 with wildcard mapping.

Resources