modelcontextprotocol / modelcontextprotocol/csharp-sdk
Identity Assertion Grant flow only supports OIDC ID tokens, not SAML 2.0 assertions
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Description
IdentityAssertionGrantProvider (added in #1305) hardcodes the RFC 8693 subject token type to urn:ietf:params:oauth:token-type:id_token in IdentityAssertionGrant.RequestJwtAuthorizationGrantAsync (subject_token_type = TokenTypeIdToken), and the public IdentityAssertionGrantIdTokenCallback returns only an ID token string. So today the flow is OIDC-ID-token-only.
RFC 8693 and the Identity Assertion Authorization Grant draft also allow SAML 2.0 assertions as the subject token. The Python SDK (PR #1721) parameterizes subject_token_type to support this. We even already declare an unused TokenTypeSaml2 constant in IdentityAssertionGrant.cs, which implies support we don't actually have.
Suggested direction
Adding SAML 2.0 support would be additive and doesn't need to block #1305:
- Either introduce a parallel subject-assertion callback (e.g. a
SubjectAssertionCallbackreturning the assertion plus its token type), or add a subject-token-type field onIdentityAssertionGrantProviderOptionsand thread it through the RFC 8693 exchange.
Until then, we should either wire up TokenTypeSaml2 or drop the unused constant so the code doesn't imply unsupported functionality.
Related: #1305
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading IdentityAssertionGrant.cs, especially IdentityAssertionGrantProvider, RequestJwtAuthorizationGrantAsync, IdentityAssertionGrantIdTokenCallback, and the unused TokenTypeSaml2 constant. Trace how IdentityAssertionGrantProviderOptions reaches the RFC 8693 exchange, then determine whether the callback or options approach fits; done means SAML 2.0 assertions are accepted while existing OIDC ID-token behavior remains supported, or the unused constant is removed if support is not added.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100