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)
{
claimActions.MapJsonKey(AbpClaimTypes.Email, "email");
claimActions.MapJsonKey(AbpClaimTypes.UserName, "name");
claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number");
claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified");
if (AbpClaimTypes.UserName != "name")
{
claimActions.MapJsonKey(AbpClaimTypes.UserName, "name");
claimActions.DeleteClaim("name");
}
claimActions.MapJsonKeyMultiple(AbpClaimTypes.Role, "role");
if (AbpClaimTypes.Email != "email")
{
claimActions.MapJsonKey(AbpClaimTypes.Email, "email");
claimActions.DeleteClaim("email");
}
claimActions.DeleteClaim("name");
claimActions.DeleteClaim("email");
if (AbpClaimTypes.EmailVerified != "email_verified")
{
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)

Loading…
Cancel
Save