I have an ASP.Net application that uses OWIN and External logins through a third party provider, specifically google.
During Authentication, this code is used to pull the ClaimsIdentity from the OwinContext
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
where AuthenticationManager is
private IAuthenticationManager AuthenticationManager
{
get
{
return HttpContext.GetOwinContext().Authentication;
}
}
However, on subsequent requests (i.e. redirecting to the home page after successful login) the GetExternalLoginInfoAsync() returns null. What I want to do is access information about the user's account (i.e. profile picture) that the external provider returns from my auth request. How can I access these Claims from an MVC controller or a Web API controller?
Almost all of the code I have is Visual Studio boiler plate code, so I won't include it here, but I can add some if anything specific is needed.
Thanks for any help you can offer.