I've built an AspnetCore 1.1 Web Application and I've to migrate authentication from Google + Sign In to new Google Sign In. I've found on web many suggestions for AspNet Core 2.x but noone for AspNet Core 1.x. One of these suggestions was to add following code to startup class:
services.AddAuthentication().AddGoogle(googleOptions =>
{
googleOptions.ClientId = Configuration["Authentication:Google:ClientId"];
googleOptions.ClientSecret = Configuration["Authentication:Google:ClientSecret"];
googleOptions.UserInformationEndpoint = "https://openidconnect.googleapis.com/v1/userinfo";
googleOptions.ClaimActions.Clear();
googleOptions.ClaimActions.MapJsonKey(ClaimTypes.Name, "email");
googleOptions.ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_Name");
googleOptions.ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_Name");
googleOptions.ClaimActions.MapJsonKey("urn:google:profile", "profile");
googleOptions.ClaimActions.MapJsonKey(ClaimTypes.Email, "email");
googleOptions.ClaimActions.MapJsonKey("urn:google:image", "picture");
googleOptions.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
});
My problem, in this case, is that with AspNet Core 1.x I've not "ClaimActions.MapJsonKey()" method and I don't know how to translate this code for Core 1.x.
Can someone help me? Is there another solution for AspNet Core 1.x?
Thanks in advance
On breaking changes always check ASP.NET Core Announcements GitHub repository.
The links in the issue show on this comment.
and