docs: add sandbox OIDC token endpoint#488
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-python studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-csharp studio · code · diff
✅ grid-php studio · code · diff
✅ grid-cli studio · code · diff
✅ grid-typescript studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
2c94a1c to
907c2cd
Compare
f6cc683 to
e947264
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e947264 to
8ad3d9a
Compare
Greptile SummaryThis PR adds OpenAPI documentation for the new
Confidence Score: 4/5Documentation-only change that is safe to merge; the two minor example inconsistencies do not affect API behaviour. The schema definitions and path spec are accurate, and the new curl-based walkthrough is a clear improvement over the hand-rolled JWT. Two small gaps remain: the registration OpenAPI example omits openapi/paths/sandbox/sandbox_oidc_token.yaml — example consistency and missing lifetime note; mintlify/snippets/sandbox-global-account-magic.mdx — freshness-requirement context was dropped without replacement
|
| Filename | Overview |
|---|---|
| openapi/paths/sandbox/sandbox_oidc_token.yaml | New POST /sandbox/oidc/token path definition; well-structured with appropriate sandbox-only 403, but the two request examples are inconsistent on including email |
| openapi/components/schemas/sandbox/SandboxOidcTokenRequest.yaml | New request schema; all fields correctly marked optional/required, constraints look correct |
| openapi/components/schemas/sandbox/SandboxOidcTokenResponse.yaml | New response schema; all required fields present, example timestamps are consistent with each other and with the embedded JWT payload |
| openapi/components/schemas/sandbox/SandboxOidcProvider.yaml | New enum schema for GOOGLE and APPLE providers; clean and minimal |
| mintlify/snippets/sandbox-global-account-magic.mdx | Replaces the hand-rolled Node.js JWT snippet with a clean curl-based flow using the new helper endpoint; removes the explicit claim requirements list without replacing them with a note about the 60-second token lifetime |
| mintlify/global-accounts/platform-tools/sandbox-testing.mdx | Minor wording updates to reference the new helper endpoint; changes are accurate and consistent |
| openapi/openapi.yaml | Adds the new path ref in the correct Sandbox section alongside the existing sandbox webhook test endpoint |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant SB as POST /sandbox/oidc/token
participant Creds as POST /auth/credentials
participant Verify as POST /auth/credentials/{id}/verify
Note over Dev,Verify: OAuth credential registration
Dev->>SB: provider, subject, email
SB-->>Dev: oidcToken (60s lifetime)
Dev->>Creds: "type=OAUTH, oidcToken"
Creds-->>Dev: credentialId
Note over Dev,Verify: OAuth credential verification
Dev->>SB: provider, subject, clientPublicKey, email
SB-->>Dev: "oidcToken with nonce=sha256(clientPublicKey)"
Dev->>Verify: "type=OAUTH, oidcToken, clientPublicKey"
Verify-->>Dev: session / auth result
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
openapi/paths/sandbox/sandbox_oidc_token.yaml:23-27
The `credentialRegistration` example omits `email` while the `credentialVerify` example includes it, and the MDX code snippet for registration also includes `email`. A user who copies the `credentialRegistration` example will get a Grid-derived deterministic email on the credential, then must remember not to supply an explicit email in the verify token — or must use the same deterministic value. Adding `email` to the registration example keeps the two examples symmetric and matches the MDX walkthrough.
```suggestion
credentialRegistration:
summary: Mint a token for OAuth credential registration
value:
provider: GOOGLE
subject: alice
email: alice@example.com
```
### Issue 2 of 2
openapi/paths/sandbox/sandbox_oidc_token.yaml:1-10
**Short token lifetime not surfaced in the endpoint description**
The response example shows `issuedAt: 2026-05-21T20:00:00Z` and `expiresAt: 2026-05-21T20:01:00Z` — a 60-second window — matching the embedded JWT's `iat`/`exp` difference. The snippet used to document the 60-second `iat` freshness requirement explicitly, but that text was removed as part of this PR. Without a note in the endpoint description, a developer who manually inspects the token (e.g., copy-pasting instead of piping through `jq`) will get a `401` on first use without an obvious cause. Adding a sentence like "The minted token is valid for 60 seconds; use it immediately." to the `description` field would close this gap.
Reviews (1): Last reviewed commit: "docs: add sandbox OIDC token endpoint" | Re-trigger Greptile
| credentialRegistration: | ||
| summary: Mint a token for OAuth credential registration | ||
| value: | ||
| provider: GOOGLE | ||
| subject: alice |
There was a problem hiding this comment.
The
credentialRegistration example omits email while the credentialVerify example includes it, and the MDX code snippet for registration also includes email. A user who copies the credentialRegistration example will get a Grid-derived deterministic email on the credential, then must remember not to supply an explicit email in the verify token — or must use the same deterministic value. Adding email to the registration example keeps the two examples symmetric and matches the MDX walkthrough.
| credentialRegistration: | |
| summary: Mint a token for OAuth credential registration | |
| value: | |
| provider: GOOGLE | |
| subject: alice | |
| credentialRegistration: | |
| summary: Mint a token for OAuth credential registration | |
| value: | |
| provider: GOOGLE | |
| subject: alice | |
| email: alice@example.com |
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/sandbox/sandbox_oidc_token.yaml
Line: 23-27
Comment:
The `credentialRegistration` example omits `email` while the `credentialVerify` example includes it, and the MDX code snippet for registration also includes `email`. A user who copies the `credentialRegistration` example will get a Grid-derived deterministic email on the credential, then must remember not to supply an explicit email in the verify token — or must use the same deterministic value. Adding `email` to the registration example keeps the two examples symmetric and matches the MDX walkthrough.
```suggestion
credentialRegistration:
summary: Mint a token for OAuth credential registration
value:
provider: GOOGLE
subject: alice
email: alice@example.com
```
How can I resolve this? If you propose a fix, please make it concise.| post: | ||
| summary: Create a sandbox OIDC token | ||
| description: > | ||
| Mint a JWT-shaped OIDC ID token for embedded-wallet OAuth sandbox flows. | ||
| Use the returned `oidcToken` anywhere the OAuth auth credential endpoints | ||
| expect an OIDC token. This endpoint only mints a mock token; it does not | ||
| create auth methods, wallets, sessions, or Turnkey state. | ||
|
|
||
| This endpoint is only for the sandbox environment and will fail for | ||
| production platforms/keys. |
There was a problem hiding this comment.
Short token lifetime not surfaced in the endpoint description
The response example shows issuedAt: 2026-05-21T20:00:00Z and expiresAt: 2026-05-21T20:01:00Z — a 60-second window — matching the embedded JWT's iat/exp difference. The snippet used to document the 60-second iat freshness requirement explicitly, but that text was removed as part of this PR. Without a note in the endpoint description, a developer who manually inspects the token (e.g., copy-pasting instead of piping through jq) will get a 401 on first use without an obvious cause. Adding a sentence like "The minted token is valid for 60 seconds; use it immediately." to the description field would close this gap.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/paths/sandbox/sandbox_oidc_token.yaml
Line: 1-10
Comment:
**Short token lifetime not surfaced in the endpoint description**
The response example shows `issuedAt: 2026-05-21T20:00:00Z` and `expiresAt: 2026-05-21T20:01:00Z` — a 60-second window — matching the embedded JWT's `iat`/`exp` difference. The snippet used to document the 60-second `iat` freshness requirement explicitly, but that text was removed as part of this PR. Without a note in the endpoint description, a developer who manually inspects the token (e.g., copy-pasting instead of piping through `jq`) will get a `401` on first use without an obvious cause. Adding a sentence like "The minted token is valid for 60 seconds; use it immediately." to the `description` field would close this gap.
How can I resolve this? If you propose a fix, please make it concise.| @@ -0,0 +1,31 @@ | |||
| type: object | |||
| required: | |||
There was a problem hiding this comment.
is this to generate a fake oidc token?
I'm not certain that we'll need to do this? I think if an integrator is going down this path, they probably already have a OIDC token provider.

Summary
POST /sandbox/oidc/token, including provider enum, request, response, examples, and sandbox-only errors.openapi.yamlandmintlify/openapi.yaml.Stack
main -> #487 -> #488.Test Plan
make lintnpx markdownlint mintlify/snippets/sandbox-global-account-magic.mdx mintlify/global-accounts/platform-tools/sandbox-testing.mdxgit diff --check