Skip to content

Commit

Permalink
Merge pull request #15005 from abpframework/openiddict-rc
Browse files Browse the repository at this point in the history
Upgrade OpenIddict to 4.0 rc1.
  • Loading branch information
realLiangshiwei authored Dec 8, 2022
2 parents 8ab8ffd + 0f500d5 commit 04b1235
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OpenIddict.Server.AspNetCore" Version="4.0.0-preview5.22557.92" />
<PackageReference Include="OpenIddict.Validation.AspNetCore" Version="4.0.0-preview5.22557.92" />
<PackageReference Include="OpenIddict.Validation.ServerIntegration" Version="4.0.0-preview5.22557.92" />
<PackageReference Include="OpenIddict.Server.AspNetCore" Version="4.0.0-rc1.22607.41" />
<PackageReference Include="OpenIddict.Validation.AspNetCore" Version="4.0.0-rc1.22607.41" />
<PackageReference Include="OpenIddict.Validation.ServerIntegration" Version="4.0.0-rc1.22607.41" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ private void AddOpenIddictServer(IServiceCollection services)
.AddServer(builder =>
{
builder
.SetAuthorizationEndpointUris("/connect/authorize", "/connect/authorize/callback")
// /.well-known/oauth-authorization-server
// /.well-known/openid-configuration
.SetAuthorizationEndpointUris("connect/authorize", "connect/authorize/callback")
// .well-known/oauth-authorization-server
// .well-known/openid-configuration
//.SetConfigurationEndpointUris()
// /.well-known/jwks
// .well-known/jwks
//.SetCryptographyEndpointUris()
.SetDeviceEndpointUris("/device")
.SetIntrospectionEndpointUris("/connect/introspect")
.SetLogoutEndpointUris("/connect/logout")
.SetRevocationEndpointUris("/connect/revocat")
.SetTokenEndpointUris("/connect/token")
.SetUserinfoEndpointUris("/connect/userinfo")
.SetVerificationEndpointUris("/connect/verify");
.SetDeviceEndpointUris("device")
.SetIntrospectionEndpointUris("connect/introspect")
.SetLogoutEndpointUris("connect/logout")
.SetRevocationEndpointUris("connect/revocat")
.SetTokenEndpointUris("connect/token")
.SetUserinfoEndpointUris("connect/userinfo")
.SetVerificationEndpointUris("connect/verify");
builder
.AllowAuthorizationCodeFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OpenIddict.Abstractions" Version="4.0.0-preview5.22557.92" />
<PackageReference Include="OpenIddict.Abstractions" Version="4.0.0-rc1.22607.41" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftPackageVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OpenIddict.Core" Version="4.0.0-preview5.22557.92" />
<PackageReference Include="OpenIddict.Core" Version="4.0.0-rc1.22607.41" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -75,31 +75,31 @@ public async ValueTask<OpenIddictApplicationModel> FindByClientIdAsync(string id
return (await Repository.FindByClientIdAsync(identifier, cancellationToken: cancellationToken)).ToModel();
}

public async IAsyncEnumerable<OpenIddictApplicationModel> FindByPostLogoutRedirectUriAsync(string address, [EnumeratorCancellation] CancellationToken cancellationToken)
public async IAsyncEnumerable<OpenIddictApplicationModel> FindByPostLogoutRedirectUriAsync(string uris, [EnumeratorCancellation] CancellationToken cancellationToken)
{
Check.NotNullOrEmpty(address, nameof(address));
Check.NotNullOrEmpty(uris, nameof(uris));

var applications = await Repository.FindByPostLogoutRedirectUriAsync(address, cancellationToken);
var applications = await Repository.FindByPostLogoutRedirectUriAsync(uris, cancellationToken);

foreach (var application in applications)
{
var addresses = await GetPostLogoutRedirectUrisAsync(application.ToModel(), cancellationToken);
if (addresses.Contains(address, StringComparer.Ordinal))
if (addresses.Contains(uris, StringComparer.Ordinal))
{
yield return application.ToModel();
}
}
}

public async IAsyncEnumerable<OpenIddictApplicationModel> FindByRedirectUriAsync(string address, [EnumeratorCancellation] CancellationToken cancellationToken)
public async IAsyncEnumerable<OpenIddictApplicationModel> FindByRedirectUriAsync(string uri, [EnumeratorCancellation] CancellationToken cancellationToken)
{
Check.NotNullOrEmpty(address, nameof(address));
Check.NotNullOrEmpty(uri, nameof(uri));

var applications = await Repository.FindByRedirectUriAsync(address, cancellationToken);
var applications = await Repository.FindByRedirectUriAsync(uri, cancellationToken);
foreach (var application in applications)
{
var addresses = await GetRedirectUrisAsync(application.ToModel(), cancellationToken);
if (addresses.Contains(address, StringComparer.Ordinal))
var uris = await GetRedirectUrisAsync(application.ToModel(), cancellationToken);
if (uris.Contains(uri, StringComparer.Ordinal))
{
yield return application.ToModel();
}
Expand Down Expand Up @@ -423,12 +423,12 @@ public virtual ValueTask SetPermissionsAsync(OpenIddictApplicationModel applicat
return default;
}

public virtual ValueTask SetPostLogoutRedirectUrisAsync(OpenIddictApplicationModel application, ImmutableArray<string> addresses,
public virtual ValueTask SetPostLogoutRedirectUrisAsync(OpenIddictApplicationModel application, ImmutableArray<string> uris,
CancellationToken cancellationToken)
{
Check.NotNull(application, nameof(application));

if (addresses.IsDefaultOrEmpty)
if (uris.IsDefaultOrEmpty)
{
application.PostLogoutRedirectUris = null;
return default;
Expand All @@ -437,9 +437,9 @@ public virtual ValueTask SetPostLogoutRedirectUrisAsync(OpenIddictApplicationMod
application.PostLogoutRedirectUris = WriteStream(writer =>
{
writer.WriteStartArray();
foreach (var address in addresses)
foreach (var uri in uris)
{
writer.WriteStringValue(address);
writer.WriteStringValue(uri);
}
writer.WriteEndArray();
});
Expand Down Expand Up @@ -472,12 +472,12 @@ public virtual ValueTask SetPropertiesAsync(OpenIddictApplicationModel applicati
return default;
}

public virtual ValueTask SetRedirectUrisAsync(OpenIddictApplicationModel application, ImmutableArray<string> addresses,
public virtual ValueTask SetRedirectUrisAsync(OpenIddictApplicationModel application, ImmutableArray<string> uris,
CancellationToken cancellationToken)
{
Check.NotNull(application, nameof(application));

if (addresses.IsDefaultOrEmpty)
if (uris.IsDefaultOrEmpty)
{
application.RedirectUris = null;
return default;
Expand All @@ -486,9 +486,9 @@ public virtual ValueTask SetRedirectUrisAsync(OpenIddictApplicationModel applica
application.RedirectUris = WriteStream(writer =>
{
writer.WriteStartArray();
foreach (var address in addresses)
foreach (var uri in uris)
{
writer.WriteStringValue(address);
writer.WriteStringValue(uri);
}
writer.WriteEndArray();
});
Expand Down

0 comments on commit 04b1235

Please sign in to comment.