.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Authentication with a UNC Virtual Directory.

Posted By:      Posted Date: September 04, 2010    Points: 0   Category :ASP.Net
I'm using IIS7.5 and Windows Authentication through an ISA server. I'm trying to migrate a classic ASP application to ASP.net.We have an internal file server with our department folders on and I'm trying to provide web based access to these. Previously I created a UNC virtual directory to the \\server\departments share, and because ASP classic ran in the context of the authenticated user they could only browse folders they had permission to.What security settings should I now be using for the Application Pool and what settings should I use on the Virtual Directory credentials to ensure security? I'd like the ASP.net page to run in the context of the logged in user, and when the code tries to display a sub-folder they don't have access to it should 'bomb out' as before.Thanks

View Complete Post

More Related Resource Links

Difference Btw Website vs Web application and Virtual directory in IIS 7


May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net


Thanks in Advance.


Authentication With Active Directory AD Getting properties


Authentication with AD is just a call to the predefined function.. Surprised
you just need following references:Embarassed

using System.DirectoryServices;
using System.DirectoryServices.AccountManagement;
using System.DirectoryServices.ActiveDirectory;

and one dll:
using UserAuthentication; //dll that you need to be download.. search for it from our god: googleWink


string adPath = "LDAP://" + System.Configuration.ConfigurationSettings.AppSettings["DefaultActiveDirectoryServer"];
ActiveDirectoryValidator adAuth = new ActiveDirectoryValidator(adPath);
if (adAuth.IsAuthenticated(domainName, userName, password))
//user is authenticated with the given username and password<br/></div></div><div class=

send credentials for virtual directory through application

Hi All,Please let me know that how to send credentials for virtual directory through application.Thanking You...

Pass virtual directory credentials through application

Hi All,We have created a website and for the secured files created a virtual directory and in virtual directory properties we selected Application-user(pass through authentication).If any user directly browse the files link then the browser prompts a screen for virtual directory credentials.Here my requirement is i need to send the virtual directory credentials through the application.Please let me know.Thanking You..

Forms authentication and Active Directory? Help!

Hi, im new to sharepoint 2010. im in a situation whereby i would like to allow users that already have Active directory accounts log into sharepoint. The problem arises when i need to allow external users to log into the sharepoint site too and it will not be possible to add them into the active directory. Is there a way to resolve this problem? Appreciate all help given! Thanks! norphos

Active Directory user impersonation with forms authentication

I've written a small ASP.NET 3.5 application to allow users to update selected account attributes on their own. Everything works fine when I use Basic Authentication, but because the dialog that is presented is less than ideal, I'd like to use forms authentication to give the users more instruction on how to log in. My problem is that in order for the user to update their account information, I have to have the application impersonate them for the update actions. I've scoured the internet trying to find a solution to my issue, but nothing fits or works. I have tried setting the web.config:<identity impersonate="true" /> but that doesn't seem to work. I also have the C# code using the WindowsImpersonationContext class, but still no luck. protected void titleTextBox_TextChanged(object sender, EventArgs e) { TextBox tb = (TextBox)sender; string fieldTitle = "job title"; string fieldName = "title"; if (userDirectoryEntry == null) CaptureUserIdentity(); try { WindowsImpersonationContext impersonationContext = userWindowsIdentity.Impersonate(); if (String.IsNullOrEmpty(tb.Text)) userDirectoryEntry.Properties[fieldName].Clear();

Redirecting default.aspx to root virtual directory

I have a simple ASP.NET 3.5 application running under IIS7 under a virtual directory. So the URL of my app is like http://site.com/app. I want to 301-redirect the request to site.com/app/default.aspx to site.com/app for better SEO. I have to do this redirect through code only, not by any IIS settings. I am unable to do so via code mentioned in this article:http://www.4guysfromrolla.com/articles/072810-1.aspxThe code:if (request.RawUrl.Equals("/default.aspx")) { newUrl = string.Format("{0}://{1}{2}", request.Url.Scheme, request.Url.Authority, request.RawUrl.Remove(request.RawUrl.LastIndexOf("/default.aspx", StringComparison.OrdinalIgnoreCase))); context.Response.Status = "301 moved permanently"; context.Response.AddHeader("Location", newUrl); } seems to go into an infinite loop when the application is under a virtual directory. the request.RawUrl property always returns "/default.aspx" even after a 301 redirect causing the infinite loop. How can I fix this issuhttp://forums.asp.net/AddPost.aspx?ForumID=27e?

javascript web service in different virtual directory?

Hi, I've searched far and wide, but can't find out why this is happening. I have a clientside javascript ajax call into a web service that works fine if both the service and the calling page are in the same directory. If I try to move the web service to another virtual directory, I get this: Exception type: InvalidOperationException Exception message: Request format is unrecognized for URL unexpectedly ending in '/js'. Here are the relevant code tidbits for the separate directories attempt. Thanks for any help! aspx file:<div> <form id="form1" runat="server"> <asp:ScriptManager runat="server" ID="scriptManagerId"> <Scripts> <asp:ScriptReference Path="CallYahooQuotesServiceMethods.js" /> </Scripts> <Services> <asp:ServiceReference Path="/quotesservice/YahooQuotesService.asmx" /> <--- this works if remove /quotesservice/ and service is in same dir </Services> </asp:ScriptManager> </form> </div> <div>  <input type="button" value="Client" id="Button2" onclick="GetQuotes(ticker

Virtual Directory in VS

Hello,I'm using VS to produce my website.In IIS, this website has one virtual directory mapped on another physical directory on the disk.How can I include this directory in my VS project ?Website structure://physical_dir1/physical_dir2/virtual_dirDisk structure:c:\www\root\c:\www\root\physical_dir1c:\www\root\physical_dir2c:\anotherPath\ pathToVirtualDirAs my .csproj file is in c:\www\root, VS can't "see" the virtualdirMy question is not how to create the virtual dir in IIS, it's already done and all is ok. My question is how to include this dir in my projet in VSMany thanks for your help

MVC Forms Authentication With Active Directory

Hi there,I am just getting started with MVC and I was wondering if someone could point me in the right direction for help with forms authentication using active directory? I have the sample site up but the results I have found on google have not been very helpful in answering this question.This site is going to be an intranet page that we want users to be able to access without logging in when they access it from our network while they must login when trying to access it from home.Any suggestions of where to start?

Changing an authentication of SharePoint site from SQL-FBA to Active Directory

Hi,      We are using MOSS 2007. I have customized a web application using Custom web part, features and ASPX pages. we have configured SQL-Form based Authentication for this site. I have also used FBA user management functionality from Codeplex. I have created some groups and my application (custom aspx page) is referencing these groups to send an email to specific person as per his role for certail events.        I have a requirement to migrate this set up on other server and change the authentication from SQL-FBA to Active Directory. So if I have to change the Authentication from SQL-FBA to AD then what are the steps I have to follow to make this happen?      I would appreciate any help on this. Thanks, Patav    

LDAP - directory entry issue with out user and password using impersonate and windows authentication

Hi All I am using the below code to fetch the user information from LDAP             DirectoryEntry entry = new DirectoryEntry("LDAP://DEV");             DirectorySearcher searcher =  new DirectorySearcher(entry);             SearchResult result;             searcher.Filter = "samaccountname=testuser";             result = searcher.FindOne(); here i am using windows authentication always and along with that when i enable the impersonate = true ,  the code fails at "result = searcher.FindOne();" with message "object reference not set to instance of an object "  also with the same code if i give the username and password along with the impersonate tag >> it works  or if i am using the user and password along with the DirectoryEntry  object then also it will work  but it fails with same user that i gave in impersonate tag / directory entry object with windows authentication enabled  and the  user logged to the application and no username and password tag in directory entry / impersonate tag  Interesting thing is that  in our development server ,  i am able to execute the same code with out user name p

Map a network share to a virtual directory path @ runtime

Hi Guys Have run into an interesting issue. We have an asp.net web application - we can deploy it over the internet, the secure intranet, local offline user laptops. On of the teams in our organization has a product by which they develop static html reports from the main database. Originally we developed a module in our app which is nothing more than an iframe. Since the html files were pushed under our application virtual directory we used to use java script to set the source of iframe to http://server/app/module/fileXXX.html   Now due to some deployment procedure changes and some security issues the html reports will be deployed on another network server and exposed through a share. Also the share will not have IIS so not virtual directory. So we can no longer set the iframe source through java script to a web file.   Is there any way i can @ runtime map a folder in my application virtual to the network share so that we can browse to these web files like before (Copying the files over from the share to my Virtual Directory is not a very elegant soln.)   Thanks Regards Siddharth

Passing Credentials to IIS "Integrated Windows authentication" Protected Directory

Hello All,I have set up a directory on my IIS web server that is protected by "Integrated Windows authentication".  I want visitors to be required to enter a name and password to view files in the protected directory except if they are following a link to files in the protected directory from a certain page on my website.I am doing this to try to get better protection from search engine spidering than is provided by using a robots.text file. I am using ASP.NET 3.5 with VB.  I am wondering if there is a way to pass the log on credentials to the IIS server via a link, or if there is a way to fill in the name and password for the login screen automatically, or something else that would work.  It is OK if the login name and password are visible to the visitors.Any suggestions on how to do this would be appreciated or if there is a better way to accomplish what I am trying to do, I would like to know.Thanks 

MaintainScrollPositionOnPostback = true is not working in IIS 6 with virtual directory is running A

Hi All, virtual directory is running ASP.NET 2.0.50727 Environment details: IIS 6 on Win Server 2003 The virtual directory is running ASP.NET 2.0.50727 I have set maintainScrollPositionOnPostBack="True" in the page directive Any ideas? Do I need to install any service packs? also the app is not working well with firefox in some scenarios

SSRS 2008- redirect to /Reports virtual directory?

We have just configured a new SQL Server Reporting Services 2008 server. So far, everything is going well, with the exception of one thing: we want anyone who hits the root of the webserver to be redirected to the /Reports virtual directory. So, if the user enters http://servername.domain.com/ it would redirect to http://servername.domain.com/reports. In SSRS 2005, it was easy to configure IIS to do this, but with SSRS 2008, I cannot figure out how to make this change. Help?

i cannot access iis virtual directory using http protocol..getting status code error 403

i am trying to connect to remote exchange using powershell..while using powershell session i get status error 403...i changed the settings in iis manager...i have set all the settings in the iis manager as said in the msdn support blogs...yet i get the same error when i access it in the client url and also in powershell of the client computer...if i cannot connect using powershell,can i connect using .net???somebody help me...i am beginner and i am stuck...
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend