Skip to content

Commit

Permalink
Google+ Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPetrinolis committed Jan 9, 2019
1 parent 146ff3e commit 5e3386e
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Google;
Expand Down Expand Up @@ -75,6 +76,18 @@ public void Configure(string name, GoogleOptions options)
{
options.CallbackPath = settings.CallbackPath;
}

// https://github.com/aspnet/AspNetCore/issues/6486
// should be removed after February 2.2 patches
options.UserInformationEndpoint = "https://www.googleapis.com/oauth2/v2/userinfo";
options.ClaimActions.Clear();
options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id");
options.ClaimActions.MapJsonKey(ClaimTypes.Name, "name");
options.ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name");
options.ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name");
options.ClaimActions.MapJsonKey("urn:google:profile", "link");
options.ClaimActions.MapJsonKey(ClaimTypes.Email, "email");

}

public void Configure(GoogleOptions options) => Debug.Fail("This infrastructure method shouldn't be called.");
Expand Down

0 comments on commit 5e3386e

Please sign in to comment.