Solved

Linking Common Access Card (CAC)  and Active Directory

Posted on 2010-08-15
6
2,990 Views
Last Modified: 2013-12-24

I am trying to work with Common Access Card (CAC) and Active Directory on the 2003 Windows Server with IIS 6.0. Once a person accesses my page on the server, code needs to automatically map a Common Access Card's "Identification" number to an individual's Active Directory 2003 account. Please let me know if anyone has tried this before. I am using ASP.NET and C#.



0
Comment
Question by:nsdlsandy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 14

Expert Comment

by:Dustin Hopkins
ID: 33447983
Do you use CACs to login to AD? Generally AD is configured for CAC login by Setting the User logon name to the EDIPI then setting the pre 2000 logon name to the actual username. Generally to do this you would restrict the site to CAC only, then pull the users windows credentials.
0
 
LVL 1

Author Comment

by:nsdlsandy
ID: 33449086
Thanks for your input.
How can we do this - "Generally to do this you would restrict the site to CAC only, then pull the users windows credentials?"

0
 
LVL 14

Expert Comment

by:Dustin Hopkins
ID: 33449395
You need to enable windows authentication. Then Require SSL and require client certificates.
Then only add the CAC Cert Authorities to the CTL(Certificate trust list).

This setup will require the user to select the cac certificate and enter their PIN. Then use page.user.identity.name will pull Domain\username.

Also, this allows you to pull the user's client certificate info which includes the EDIPI
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 1

Author Comment

by:nsdlsandy
ID: 33501500
dusion,

sorry for the late response. I was trying to see any alternate method but found none so far.
Do you have the code to do the stuff you mentioned in the previous post.

thanks
Sandy
0
 
LVL 14

Accepted Solution

by:
Dustin Hopkins earned 500 total points
ID: 33553875
Sorry, I've been quite busy the past week. Here is some code to help.
Note, this code is only relevant after your require client certificates in IIS.
Also, here is a helpful link: http://forums.asp.net/p/1356598/2785315.aspx

Then to configure IIS to re quire Client Certs:

You need to go to IIS Manager->Default Website-> right click and go to Properties->Directory Security->Under Secure Communications section, click on Edit.
>Click require SSL and 128 bit. Then click require client certificates.

If this is a CAC or DoD setup then you must have activclient and tumbleweed installed on the server as well as your dod certificates which you should have if you have an ssl cert issued from C Auth.

Make sure to configure your CTL to only accept the certificates issued for your smart cards.
       HttpClientCertificate cs = Request.ClientCertificate;
        string[] subjectArray = cs.Subject.Split(',');

//Holds the entire contents of the subject line.
        string entireSubjectLine = cs.Subject.ToString();

  	//gets the total length of the subject line
        int subjectLineLength = entireSubjectLine.Length;  

//-10 grabs the start of the 10 digit CAC identifer code for the user.
        int startOfCacIdentifierPosition = subjectLineLength - 10; 

string cacIdentifier = entireSubjectLine.Substring(startOfCacIdentifierPosition, 10);
        
        string[] arr = subjectArray[5].Split(' ');
        string[] user = arr[1].Split('=');
        StringBuilder sb = new StringBuilder();
        foreach (string field in user)
        {
            sb.Append(field);
        }
        sb.Remove(0, 2);
        
        string str1 = sb.ToString();
        string[] sArr1 = str1.Split('.');
        string lastName = sArr1[0].ToString();
        string firstName = sArr1[1].ToString();
        string MI = sArr1[2].ToString();
        string Id = cacIdentifier; //10 Digit Unique CAC identifier

Open in new window

0
 
LVL 1

Author Closing Comment

by:nsdlsandy
ID: 33628142
This is not the exact solution but it is good enough to get me started.
thanks for been patient as I juggled different stuff at my end.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question