I have a MVC project that users currently can log into automatically via their identity.
The users of this website can only log into their computers by using a smart card, therefor i simply use HttpContext.User.Identity.Name
to get their username in the portal which is used as a parameter for various API calls.
Now this has changed and they can now log into their computers with their smart card or a none personal AD user. I need to change the logic so if they are not using a smart card i need to show a login view.
pseudo code for what i want to do:
if(SmartCardInserted)
{
username = HttpContext.User.Identity.Name
}
else
{
//redirect to login page and get username from there
}
My problem is that i can't find a simple solution for SmartCardInserted
, i just need to know if there is a smartcard inserted or not. How can i do this?