Skip to content

Commit

Permalink
Upgrade to OpenIddict 4 (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad authored Oct 24, 2023
1 parent f23117b commit b843d24
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,9 @@ public async Task<IActionResult> Exchange()
Claims.Name, Claims.Role);

// Use the client_id as the subject identifier.
identity.AddClaim(Claims.Subject, (await _applicationManager.GetClientIdAsync(application))!,
Destinations.AccessToken, Destinations.IdentityToken);
identity.SetClaim(Claims.Subject, (await _applicationManager.GetClientIdAsync(application))!);

identity.AddClaim(Claims.Name, (await _applicationManager.GetDisplayNameAsync(application))!,
Destinations.AccessToken, Destinations.IdentityToken);
identity.SetClaim(Claims.Name, (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.
Expand Down
8 changes: 4 additions & 4 deletions dotnet-authserver/src/TeacherIdentity.AuthServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ public static async Task Main(string[] args)
options.SetIssuer(new Uri(baseAddress));

options
.SetAuthorizationEndpointUris("/connect/authorize")
.SetLogoutEndpointUris("/connect/signout")
.SetTokenEndpointUris("/connect/token")
.SetUserinfoEndpointUris("/connect/userinfo");
.SetAuthorizationEndpointUris("connect/authorize")
.SetLogoutEndpointUris("connect/signout")
.SetTokenEndpointUris("connect/token")
.SetUserinfoEndpointUris("connect/userinfo");

options
.AllowAuthorizationCodeFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="All" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.6.3" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.4" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.5" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageReference Include="MiniValidation" Version="0.7.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.3" />
<PackageReference Include="OpenIddict.AspNetCore" Version="3.1.1" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="3.1.1" />
<PackageReference Include="OpenIddict.AspNetCore" Version="4.9.0" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="4.9.0" />
<PackageReference Include="Optional" Version="4.0.0" />
<PackageReference Include="Polly" Version="7.2.4" />
<PackageReference Include="RedisRateLimiting.AspNetCore" Version="1.0.7" />
Expand Down

0 comments on commit b843d24

Please sign in to comment.