I have a web app that uses the System.Directory services assembly, but I want to add the page as a web part on a SharePoint site.

When users login they are asked to enter a username and password again, presumably for the content in the web part I have created.

What do I need to do so that the user won't be prompted, how can i share the authetication token?

Thanks in advance.


Is the asp.net web application on the same domain as the SharePoint app (ie a Virtual Directory / Application) within the same IIS website?

Are you using Windows Authentication for your SharePoint install?

  • Yes i'm using Windows Auth for my SP site and yes both the apps are on the same domain but not on the same Virtual Directory.Any ideas? – naijacoder May 8 '11 at 6:21
  • fixed hosted the app on the app pool of my Sharepoint site – naijacoder Jul 22 '11 at 6:33

If you're using Windows Authentication and your clients are using IE you could add both sites to the Local Intranet zone on your clients (using a GPO or an FAQ if that's not feasible). This should enable automatic login using the current username and password.

As @Daniel says, if they're both under the same web application you should only have to authenticate once.

  • Would i have to move the asp.net app to my SP virtual directory and probably need to add the assemblies i used in the app to the GAC so SP can recognise it ?? – naijacoder May 8 '11 at 6:23
  • Regarding the app location: Yes; Regarding the assemblies location: You should be able to put them in the bin folder of the SharePoint web app if that's where they are now. – SHug May 8 '11 at 11:23
  • Hosted the app in Sharepoint and it works .But time ti time i get SERVER NOT OPERATIONAL ERROR. Chrs guys – naijacoder Jun 8 '11 at 5:06
  • That error is normally directly attributable to the System.DirectoryServices call. Have you got any logs or debug info which might help? Did the answer to your other question on SO throw up any ideas? – SHug Jun 8 '11 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.