diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs index 4ecb11e58..c99cdc77c 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs @@ -1,5 +1,4 @@ using LINGYUN.Abp.Identity; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Modularity; using VoloAbpOpenIddictAspNetCoreModule = Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule; @@ -8,13 +7,7 @@ namespace LINGYUN.Abp.OpenIddict.AspNetCore; [DependsOn( typeof(AbpIdentityDomainSharedModule), typeof(VoloAbpOpenIddictAspNetCoreModule))] +[System.Obsolete("The module has been deprecated and will be removed in future versions")] public class AbpOpenIddictAspNetCoreModule : AbpModule { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - PreConfigure(builder => - { - builder.RegisterClaims(new[] { IdentityConsts.ClaimType.Avatar.Name } ); - }); - } } diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpSessionOpenIddictClaimsPrincipalHandler.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpSessionOpenIddictClaimsPrincipalHandler.cs deleted file mode 100644 index 065fa5c43..000000000 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpSessionOpenIddictClaimsPrincipalHandler.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.OpenIddict; - -namespace LINGYUN.Abp.OpenIddict.AspNetCore; -public class AbpSessionOpenIddictClaimsPrincipalHandler : IAbpOpenIddictClaimsPrincipalHandler, ITransientDependency -{ - public Task HandleAsync(AbpOpenIddictClaimsPrincipalHandlerContext context) - { - return Task.CompletedTask; - } -} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AvatarUrlClaimsPrincipalContributor.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AvatarUrlClaimsPrincipalContributor.cs deleted file mode 100644 index 2177f8717..000000000 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AvatarUrlClaimsPrincipalContributor.cs +++ /dev/null @@ -1,33 +0,0 @@ -using LINGYUN.Abp.Identity; -using Microsoft.Extensions.DependencyInjection; -using System.Linq; -using System.Security.Claims; -using System.Security.Principal; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Identity; -using Volo.Abp.Security.Claims; - -namespace LINGYUN.Abp.OpenIddict.AspNetCore; -public class AvatarUrlClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency -{ - public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) - { - var identity = context.ClaimsPrincipal.Identities.FirstOrDefault(); - if (identity != null) - { - if (identity.HasClaim(x => x.Type == IdentityConsts.ClaimType.Avatar.Name)) - { - return; - } - var userManager = context.ServiceProvider.GetRequiredService(); - var user = await userManager.GetUserAsync(context.ClaimsPrincipal); - var userClaims = await userManager.GetClaimsAsync(user); - var userAvatarUrl = userClaims.FirstOrDefault(x => x.Type == IdentityConsts.ClaimType.Avatar.Name); - if (userAvatarUrl != null) - { - identity.AddIfNotContains(new Claim(IdentityConsts.ClaimType.Avatar.Name, userAvatarUrl.Value)); - } - } - } -} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs index 4bcd71716..71ac6a1ba 100644 --- a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs @@ -1,7 +1,6 @@ using OpenIddict.Abstractions; using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Security.Claims; @@ -36,12 +35,6 @@ public class UserInfoController : VoloUserInfoController claims[OpenIddictConstants.Claims.PreferredUsername] = user.UserName; claims[OpenIddictConstants.Claims.FamilyName] = user.Surname; claims[OpenIddictConstants.Claims.GivenName] = user.Name; - // 重写添加用户头像 - var picture = user.Claims.FirstOrDefault(x => x.ClaimType == AbpClaimTypes.Picture); - if (picture != null) - { - claims[OpenIddictConstants.Claims.Picture] = picture.ClaimValue; - } } if (User.HasScope(OpenIddictConstants.Scopes.Email))