ssl - ASP.NET MVC 2 and request client certificate (Smart Card authentication) -
i need capture user's x.509 certificates cards , map user table forms authentication in asp.net mvc. have created mvc (ver 2) project in vs 2008, configured run virtual directory under default web site in local iis on vista using default template added requirehttpsattribute account/logon actionresult. no other changes. using local iis manager, created self-signed cert , applied it, set account/logon.aspx page require ssl , require client certificates.
running in debug, when click 'log on' link welcome page (home/index view), correctly routes account/logon.aspx using https no prompt certificate. using dynatrace (awesome, http://ajax.dynatrace.com), can see response status getting set 403 again, no cert prompt.
as sanity check, set default asp.net web app project run in virtual directory in default web site (same mvc project above) in vista , configured default.aspx page require ssl , require client certificates, done in mvc project above. ran it, works fine, certificate prompt , can choose cert , enter pin card , read x.509 request.clientcertificate object in code behind.
the application pool both virtual directories set classic .net apppool in integrated pipeline mode.
help?!
update: super kludgy workaround in progress. added folder 'auth' , 'getcert.aspx' file marked ssl/require client certificates mvc project , added "routes.ignoreroute("auth/{*pathinfo}")" global.asax. codebehind of getcert.aspx response.writes data want x.509. added jquery.get call in logon.aspx calls getcert.aspx , returns cert subject results string div in logon.aspx. cert prompt , results in mvc view, can't way this!
i have working solution using forms authentication , authorize attribute on base controller class non-authenticated requests go account/logon. logon page post button routes action called authorize decorated requirehttps attribute correctly triggers prompt client cert. once cert selected authorize action handles parsing httpclientcertificate user info want , doing match lookup in users table , writes authentication cookie. have httpmodule reads cookie create custom principal in authenticaterequest event. works great. i'm opening question next issue regarding iis configuration of 'ignore client certificates' here: https://stackoverflow.com/questions/4141272/iis-6-ssl-client-certificates-configuration
Comments
Post a Comment