Add REST API OAuth resource scopes#2336
Conversation
|
I reviewed the OAuth/resource-scope implementation at Required
Hardening / follow-up
The rest of the core flow looked sound in static review: PKCE S256 enforcement, redirect URI matching including loopback dynamic ports, resource binding, public-client-only DCR, scope-based MCP authorization, REST read/write policies, and metadata-fetch SSRF controls all look directionally correct. |
…source-scopes # Conflicts: # src/Exceptionless.Core/Services/OAuthService.cs # tests/Exceptionless.Tests/Controllers/ExceptionlessMcpToolsTests.cs
|
/preview |
|
Preview deployed
|
|
I re-reviewed the current head No blocking issues found in this pass. I specifically rechecked the earlier organization-scope concern, OAuth access/refresh token storage and revocation behavior, resource-bound bearer authentication, REST/MCP scope policy wiring, OAuth application cache invalidation, and the Svelte consent/grant-management UI. Current live checks on this head are green. GitHub still reports the PR merge state as |
Closes #2332.
Summary
/mcpand/api/v2, with resource-specific metadata, bearer challenges, and strict token/resource validation.offline_accessfor MCP consent/grants so MCP clients receive refreshable authorization.mainbranch changes into this PR branch.Compatibility
This intentionally tightens the brand-new OAuth/MCP behavior: OAuth clients now need an explicit supported resource, at least one supported resource scope, selected organizations, and MCP grants require
offline_access. New OAuth bearer tokens are stored and looked up by hash in the OAuth token index, so earlier experimental OAuth grants need to re-authorize. Non-OAuth API keys and normal user auth paths are preserved.Validation
dotnet build --no-restoredotnet test --no-build -- --filter-class Exceptionless.Tests.Controllers.OAuthControllerTestsdotnet test --no-build -- --filter-class Exceptionless.Tests.Controllers.ExceptionlessMcpToolsTestsdotnet test --no-build -- --filter-class Exceptionless.Tests.Controllers.OpenApiControllerTestsdotnet test --no-build -- --filter-class Exceptionless.Tests.Repositories.OAuthTokenRepositoryTestsdotnet test --no-build -- --filter-class Exceptionless.Tests.Serializer.Models.OAuthTokenSerializerTestsdotnet test --no-build -- --filter-class Exceptionless.Tests.Repositories.TokenRepositoryTestsdotnet test --no-build -- --filter-class Exceptionless.Tests.Serializer.Models.TokenSerializerTestsdotnet test -- --filter-class Exceptionless.Tests.Controllers.OAuthControllerTestsnpm run lintfromsrc/Exceptionless.Web/ClientAppnpm run checkfromsrc/Exceptionless.Web/ClientAppgit diff --check