maliming
3 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
5 changed files with
8 additions and
12 deletions
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo.Abp.OpenIddict.AspNetCore.csproj
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers/TokenController.ClientCredentials.cs
-
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/OpenIddictClaimsPrincipalContributor.cs
-
modules/openiddict/src/Volo.Abp.OpenIddict.Domain.Shared/Volo.Abp.OpenIddict.Domain.Shared.csproj
-
modules/openiddict/src/Volo.Abp.OpenIddict.Domain/Volo.Abp.OpenIddict.Domain.csproj
|
|
|
@ -20,8 +20,8 @@ |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="OpenIddict.Server.AspNetCore" Version="3.1.1" /> |
|
|
|
<PackageReference Include="OpenIddict.Validation.AspNetCore" Version="3.1.1" /> |
|
|
|
<PackageReference Include="OpenIddict.Validation.ServerIntegration" Version="3.1.1" /> |
|
|
|
<PackageReference Include="OpenIddict.Server.AspNetCore" Version="4.0.0-preview4.22517.68" /> |
|
|
|
<PackageReference Include="OpenIddict.Validation.AspNetCore" Version="4.0.0-preview4.22517.68" /> |
|
|
|
<PackageReference Include="OpenIddict.Validation.ServerIntegration" Version="4.0.0-preview4.22517.68" /> |
|
|
|
</ItemGroup> |
|
|
|
</Project> |
|
|
|
|
|
|
|
@ -29,13 +29,9 @@ public partial class TokenController |
|
|
|
OpenIddictConstants.Claims.PreferredUsername, OpenIddictConstants.Claims.Role); |
|
|
|
|
|
|
|
// The Subject and PreferredUsername will be removed by <see cref="RemoveClaimsFromClientCredentialsGrantType"/>.
|
|
|
|
|
|
|
|
// Use the client_id as the subject identifier.
|
|
|
|
identity.AddClaim(OpenIddictConstants.Claims.Subject, await ApplicationManager.GetClientIdAsync(application), |
|
|
|
OpenIddictConstants.Destinations.AccessToken, OpenIddictConstants.Destinations.IdentityToken); |
|
|
|
|
|
|
|
identity.AddClaim(OpenIddictConstants.Claims.PreferredUsername, await ApplicationManager.GetDisplayNameAsync(application), |
|
|
|
OpenIddictConstants.Destinations.AccessToken, OpenIddictConstants.Destinations.IdentityToken); |
|
|
|
identity.AddClaim(OpenIddictConstants.Claims.Subject, await ApplicationManager.GetClientIdAsync(application)); |
|
|
|
identity.AddClaim(OpenIddictConstants.Claims.PreferredUsername, await ApplicationManager.GetDisplayNameAsync(application)); |
|
|
|
|
|
|
|
// Note: In the original OAuth 2.0 specification, the client credentials grant
|
|
|
|
// doesn't return an identity token, which is an OpenID Connect concept.
|
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ public class OpenIddictClaimsPrincipalContributor : IAbpClaimsPrincipalContribut |
|
|
|
var clientId = httpContext.GetOpenIddictServerRequest()?.ClientId; |
|
|
|
if (clientId != null) |
|
|
|
{ |
|
|
|
identity.AddClaim(OpenIddictConstants.Claims.ClientId, clientId, OpenIddictConstants.Destinations.AccessToken); |
|
|
|
identity.AddClaim(OpenIddictConstants.Claims.ClientId, clientId); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -14,7 +14,7 @@ |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="OpenIddict.Abstractions" Version="3.1.1" /> |
|
|
|
<PackageReference Include="OpenIddict.Abstractions" Version="4.0.0-preview4.22517.68" /> |
|
|
|
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftPackageVersion)" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="OpenIddict.Core" Version="3.1.1" /> |
|
|
|
<PackageReference Include="OpenIddict.Core" Version="4.0.0-preview4.22517.68" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
</Project> |
|
|
|
|