Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the OpenID module to OpenIddict 4.0 #12804

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

kevinchalet
Copy link
Member

This PR updates the OpenID module to use OpenIddict 4.0 RTM, that will ship next month. Once 4.0 lands, the previous versions - including OpenIddict 3.x - will no longer be supported.

While OpenIddict 4.x itself has many internal improvements, the "public" API hasn't changed much so the changes made in this PR are mostly cosmetic.

Note: please don't merge this PR until the RTM bits are available on NuGet.org 😃

@kevinchalet kevinchalet added this to the 1.6 milestone Nov 12, 2022
@kevinchalet kevinchalet self-assigned this Nov 12, 2022
principal.SetResources(await GetResourcesAsync(request.GetScopes()));
identity.SetScopes(request.GetScopes());
identity.SetResources(await GetResourcesAsync(request.GetScopes()));
identity.SetDestinations(GetDestinations);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current bits, ExchangeClientCredentialsGrantType() doesn't use the GetDestinations() helper. This PR changes that so it also uses it, but I added a check in GetDestinations() to preserve the existing values if destinations were already attached to a claim.

@@ -75,34 +75,46 @@ public void Configure(OpenIddictServerOptions options)
options.SigningCredentials.Add(new SigningCredentials(key, SecurityAlgorithms.RsaSha256));
}

// Note: while endpoint paths in OrchardCore are stored as PathString instances,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More information here if you're interested in the gnarly details: openiddict/openiddict-core#1613 🤣

@kevinchalet
Copy link
Member Author

OpenIddict 4.0.0 is now generally available: https://kevinchalet.com/2022/12/23/openiddict-4-0-general-availability/ 🎁

I'll merge this PR once the CI checks are done.

@kevinchalet kevinchalet merged commit 9fb9eed into OrchardCMS:main Dec 23, 2022
@kevinchalet kevinchalet deleted the openiddict_4.0 branch December 23, 2022 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant