Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Help: ClaimsIdentity namespace or assembly cannot be found

$
0
0

I created an external Google login option on ASP.net web form site. I found when user first time login this way they will be asked for giving an Alias. Then I found the mdf in App_Data is storing log information using only the Alias of the person logging in.
My site is an Intranet.

When the staff create the Alias that could be "wildcat", "superman" etc which cannot help me identify who is who. What I need is to log using their email account name instead
(eg MaryBrown@gmail.com to be logged as either MaryBrown or the full email)

Someone in this forum gave me this but after adding many references and put it in page load event handler I still get this error:-

"ClaimsIdentity namespace or assembly cannot be found".

var identity =(ClaimsIdentity)HttpContext.User.Identity;var name = identity.Claims.FirstOrDefault(m => m.Type==System.Security.Claims.ClaimTypes.Name).Value;

Anyone please help to advise how to use this code ?

Just get the email account name to label1.text is sufficient after they login using Google account. No need to get the user profile etc.

Thanks a lot.


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>