Repository navigation
OIDC resource server: scheme, configuration and Protected Resource Metadata (1/7) - #891
Merged
Merged
Conversation
… for configuration and plugins
…arty and scope checks
…etadata endpoints
… conditions, scheme always registered The derived audience and resource_metadata URL come from the store resolved for the request, never from the Host header. Resources with account conditions are refused until those checks exist. With the resource server disabled the Oidc scheme is still registered with no issuer and no keys, so endpoints naming it answer 401. authorization_servers publishes the Authority as configured, an http Authority requires RequireHttpsMetadata=false, garbage tokens log at Information, and the startup skips an uninstalled database.
KrzysztofPajak
commented
Oct 11, 2026
KrzysztofPajak
left a comment
Member
Author
There was a problem hiding this comment.
Review of the OIDC resource server. The ones I'd address before merge: store resolution for the audience check (OidcCanonicalUri), guest-customer creation on the anonymous metadata endpoints, and the RFC 9728 metadata URL shape. The rest are robustness and nits.
…t, never the store cookie
…nt between host and resource path
…t without a resource URI
…thorization server metadata cannot be obtained
…ad of failing the request
…he startup that maps them
…source URI validation
KrzysztofPajak
added a commit
that referenced
this pull request
Oct 11, 2026
Member
Author
|
Review fixes:
|
KrzysztofPajak
added a commit
that referenced
this pull request
Oct 11, 2026
…view follow-ups of #891
KrzysztofPajak
added a commit
that referenced
this pull request
Oct 11, 2026
…view follow-ups of #891
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type: feature
Issue
GrandNode can only authenticate Web API calls with its own JWT (API users with a shared secret). Integrations, applications and MCP-class clients increasingly expect OAuth 2.1: tokens issued by the organisation's identity provider, audience-bound to the resource, discoverable through Protected Resource Metadata (RFC 9728). There was no way to accept such tokens or to let a plugin protect its own endpoints with them.
This is the first of a stack of PRs (each targets the previous one; review in order):
/registerexternal mode)Authentication.OpenIdConnectpluginSolution
GrandNode becomes an OAuth 2.1 resource server only (it never issues tokens), configured in the appsettings section
OidcResourceServer, without provider-specific code:OidcJwtBearer authentication scheme: JWKS signature, issuer, lifetime, and audience = canonical resource URI (RFC 8707) built from the store URL, never from the Host header.Resources) and from plugins (IOidcProtectedResourceProvider) through one registry; each has a path prefix, audiences, supported and required scopes, authorized parties and an optional admin-panel requirement./.well-known/oauth-protected-resource[/{path}]; 401/403 answers carryWWW-Authenticatewithresource_metadata,errorandscope, plus a ProblemDetails body.Breaking changes
None. The feature is off unless
OidcResourceServer:Enabledis true.Testing
dotnet test src/Tests/Grand.Web.Common.Tests- all pass./.well-known/oauth-protected-resourcereturns 404.docs/oidc-resource-server.md, sections 6, 7 and 10).