Browse Source

Fix AbpClaimActionCollectionExtensions.MapAbpClaimTypes

pull/1331/head
Halil İbrahim Kalkan 7 years ago
parent
commit
ea549b4305
  1. 37
      framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs

37
framework/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs

@ -7,16 +7,37 @@ namespace Microsoft.AspNetCore.Authentication.OAuth.Claims
{ {
public static void MapAbpClaimTypes(this ClaimActionCollection claimActions) public static void MapAbpClaimTypes(this ClaimActionCollection claimActions)
{ {
claimActions.MapJsonKey(AbpClaimTypes.Email, "email"); if (AbpClaimTypes.UserName != "name")
claimActions.MapJsonKey(AbpClaimTypes.UserName, "name"); {
claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified"); claimActions.MapJsonKey(AbpClaimTypes.UserName, "name");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number"); claimActions.DeleteClaim("name");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified"); }
claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role"); if (AbpClaimTypes.Email != "email")
{
claimActions.MapJsonKey(AbpClaimTypes.Email, "email");
claimActions.DeleteClaim("email");
}
claimActions.DeleteClaim("name"); if (AbpClaimTypes.EmailVerified != "email_verified")
claimActions.DeleteClaim("email"); {
claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified");
}
if (AbpClaimTypes.PhoneNumber != "phone_number")
{
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number");
}
if (AbpClaimTypes.PhoneNumberVerified != "phone_number_verified")
{
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified");
}
if (AbpClaimTypes.Role != "role")
{
claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role");
}
} }
public static void MapJsonKeyMultiple(this ClaimActionCollection claimActions, string claimType, string jsonKey) public static void MapJsonKeyMultiple(this ClaimActionCollection claimActions, string claimType, string jsonKey)

Loading…
Cancel
Save