For email, you need to add the scope "wl.emails". To access the rest of the data, you need to add claims so that you can get at it from your controller.
In Startup.Auth.cs you need something like:
var msaccountOptions = new Microsoft.Owin.Security.MicrosoftAccount.MicrosoftAccountAuthenticationOptions()
{
ClientId = /* client id */,
ClientSecret = /* client secret */,
Provider = new Microsoft.Owin.Security.MicrosoftAccount.MicrosoftAccountAuthenticationProvider()
{
OnAuthenticated = (context) =>
{
context.Identity.AddClaim(new System.Security.Claims.Claim("urn:microsoftaccount:access_token", context.AccessToken, XmlSchemaString, "Microsoft"));
foreach (var x in context.User)
{
var claimType = string.Format("urn:microsoftaccount:{0}", x.Key);
string claimValue = x.Value.ToString();
if (!context.Identity.HasClaim(claimType, claimValue))
context.Identity.AddClaim(new System.Security.Claims.Claim(claimType, claimValue, XmlSchemaString, "Microsoft"));
}
return Task.FromResult(0);
}
}
};
msaccountOptions.Scope.Add("wl.emails");
app.UseMicrosoftAccountAuthentication(msaccountOptions);
Then, in your controller action, you can access the user details like:
var identity = await HttpContext.GetOwinContext().Authentication.GetExternalIdentityAsync(DefaultAuthenticationTypes.ExternalCookie);
var firstNameClaim = identity.Claims.FirstOrDefault(c => c.Type.EndsWith("first_name"));
var firstName = firstNameClaim != null ? firstNameClaim.Value : null;
You'll need to consult the API documentation to determine the proper claim values for the service you're using.