.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

Forms authentication and Active Directory? Help!

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :SharePoint
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

View Complete Post

More Related Resource Links

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();

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?

Forms authentication using Active Directory


I need some help troubleshooting authenticating via AD. All i get from my web application is "Your login attempt was not successful. Please try again." Allthough if i look at my PDC it shows NT AUTHORITY\ANONYMOUS LOGON in the event for my authentication request. I am using the Login.aspx auto generated.

Here is my web.config file:

<?xml version="1.0"?>
		<remove name="LocalSqlServer"/>
		<add name="GoliathConnectionString" connectionString="Data Source=RBBCM\MAPDB;Initial Catalog=Goliath;Integrated Security=True" providerName="System.Data.SqlClient"/>
		<add name="ThirteenConnectionString" connectionString="Data Source=RBBCM\MAPDB;Initial Catalog=Datamine;Integrated Security=True" providerName="System.Data.SqlClient"/>
		<add name="BugTrackerConnectionString" connectionString="Data Source=RBBCM\MAPDB;Initial Catalog=BugTracker;Integrated Security=True" providerName="System.Data.SqlClient"/>
    <add name="ADConnectionString" connectionString="LDAP://SSC1/CN=Users,dc=rbbcsc,dc=k12,dc=in,dc=us" />
    <customErrors mode="Off"/>
    <compilation debug="true"/>
    <authentication mode="Fo

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=

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    

Active Directory Authentication with Login Control ASP.Net 3.5 or 4


Hello, I am trying to follow instructions on how to create a login page that tests against active directory.  My issue is all of the tutorials seem to be written for ASP.NET 2.0.  When I try to follow them I cannot get them to work.  Does anyone have any tutorial or information for .NET 3.5 or 4.0?


intranet site authentication against Active Directory


Hi all,

I am trying to build a web app for an intranet site that for security reasons needs to make the user type in their Windows or Active Directory username pwd manually. I have previously worked with Integrated Windows Auth but in this case, we do want them to use type in their AD credentials. 

I have been trying to look up how to do this and frankly I am a bit lost. It should be a fairly straightforward task and am hoping you can point me in the right direction, with some tutorials or examples. We will be using SSL so, dont have to worry about passing pwd in cleartext over the wire. 

My environment is visual studio 2008 in C#, .net 3.5 if that matters.

Any pointers ? Thank you. 

Using Active Directory Authentication when Windows Authentication fails


I have a web application (intranet based) which uses Windows Authentication.  Unfortunately there are public computers that have public logins at some company locations.  My web app doesn't support these public logins because I need to know the user working with the app.

So, even though these public users are windows authentication users, my app will fail because I have no user account setup for that particular account.  I want to then try Active Directory Authentication.

In my Default.aspx.cs I'd have something like this:

  protected void Page_Load(object sender, EventArgs e)
    userContext = new UserContext(); // If the authenticated user isn't a user in my system then throw an exception
   catch (UILayerException)
          // This I where I want to now do Active Directory Authentication
          // Maybe I redirect to a login page or what?
          // But remember the user IS authenticated even if they aren't a user in my system so I need to do something about that.

Web forms and active directory?



I am new to web forms, but how can I populate a web form (form fields i.e. name, job title, tel no etc) with that users information automatically taken from their active directory profile?  It wouldd be an Intranet application so all users would be on the domain.

How is this done in ASP.net?  In Coldfusion I would set the following variable

<cfset user = listLast(cgi.REMOTE_USER,"\") > which would grab the user id from AD

Then I would query an employee DB matching up the userid to gather their employee info

<cfquery name="querygetemp" datasource="DATASOURCE">
SELECT * FROM empl.directory

and then set variables which I would use to populate the form fields further down the page

<cfset varsection = querygetemp.section>
<cfset varjob_title = querygetemp.job_title> etc...

Any ideas on how to get around this in ASP.NET?

Login authentication using Active Directory for ASP.NET applications

This article explains how to authenticate the users while login into asp.net application against active directory in a simple way.

Explained: Forms Authentication in ASP.NET

This module explains how forms authentication works in ASP.NET version 2.0. It explains how IIS and ASP.NET authentication work together, and it explains the role and operation of the FormsAuthenticationModule class.

Using Forms Authentication in ASP.NET - Part 1

Classic ASP developers often had to "roll their own" authentication scheme, however, in ASP.NET much of the grunt work has been taken out. This article outlines how things have changed and how FormsAuthentication can be used to secure a Web site with a minimal amount of code.

ASP.NET Forms Authentication - Part 1

Often, in legacy Web applications, users authenticate themselves via a Web form. This Web form submits the user's credentials to business logic that determines their authorization level. Upon successful authentication, the application then submits a ticket in the form of a cookie, albeit a hard cookie or session variable. This ticket contains anything from just a valid session identification access token to customized personalization values.

ASP.NET forms authentication with roles

.A timeout is specified in minutes. This is "time since last request" not the "time since login". If a login is indicated to be persistent (described later) this is ignored.
.A protection method is specified for the cookie.
Next I wanted to specify a folder to which access is restricted to people who have logged in. To do this I entered the following code in the web.config file (beneath

Forms Authentication in ASP.NET

In this tutorial you will learn about Forms Authentication in ASP.NET 2.0 - Forms Authentication class, Cookie Domain, Forms Cookies, The Login Control, Signin, Signout, Authenticate, Redirect, Login Status, Login Name and Login View Controls.

Problems with Forms Authentication in DD 4 site


Hello,  I am seeing a strange problem with Forms Authentication in my DD site.   A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.

in web.config I have

     <authentication mode="Forms">
            <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" />     

Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused.   Has anyone else experienced this or have any suggestions?  Thanks!

How to set SearchRoot Path in Active Directory in this scenario


How to set SearchRoot Path in Active Directory in this scenario:

Functionality: We have scenario that 1<sup>st</sup> hit one LDAP server with some 'fixed user name' &' fixed password ' and filter data with specific User name(which given by user) getting 'User dn'.

After that we hit Next LDAP server based on the 'User dn' getting from 1<sup>st</sup> server.

(So, in my case 1<sup>st</sup> LDAP server works like as Load balancing server but functionalitywise it is different)


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