Skip to content

[grid] fix Global Account auth snippets#566

Merged
DhruvPareek merged 1 commit into
mainfrom
dp/fix-global-account-auth-snippets
Jun 10, 2026
Merged

[grid] fix Global Account auth snippets#566
DhruvPareek merged 1 commit into
mainfrom
dp/fix-global-account-auth-snippets

Conversation

@DhruvPareek

@DhruvPareek DhruvPareek commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix the Global Account auth summary so EMAIL_OTP describes the encrypted OTP + signed retry flow instead of the old one-shot verify flow.
  • Split OAUTH into its own summary bullet because it remains the one-shot verify flow with clientPublicKey.
  • Make Android and iOS passkey snippets explicit that the returned hex challenge string must be UTF-8 encoded as WebAuthn challenge bytes.

Validation

  • make build at the stack tip

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jun 10, 2026 6:34pm

Request Review

@DhruvPareek DhruvPareek marked this pull request as ready for review June 9, 2026 20:13
@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This documentation-only PR updates the Global Account authentication reference in authentication.mdx with two focused fixes: it rewrites the EMAIL_OTP summary bullet to accurately describe the HPKE-encrypted OTP plus signed-retry flow, and clarifies in the Android and iOS passkey code snippets that the Grid-issued hex challenge must be UTF-8-encoded before being passed to the platform WebAuthn APIs.

  • EMAIL_OTP/OAUTH split: The combined bullet is replaced by two separate bullets — EMAIL_OTP now describes the full challenge → HPKE-encrypt → verify → 202 → signed-retry sequence, while OAUTH retains the simpler one-shot verify with clientPublicKey.
  • Android snippet: Adds val webAuthnChallenge = base64UrlEncode(challengeResp.challenge.toByteArray(Charsets.UTF_8)) and passes the result to buildWebAuthnGetOptionsJson, matching what GetPublicKeyCredentialOption expects (base64url in the JSON options string).
  • iOS snippet: Changes the assertion request to challenge: Data(challengeResp.challenge.utf8), correctly UTF-8-encoding the hex string into Data bytes for ASAuthorizationPlatformPublicKeyCredentialProvider.

Confidence Score: 5/5

Documentation-only change with no runtime code; all updated descriptions and snippets are consistent with each other and with the detailed sections in the same file.

The PR touches only an MDX documentation file. The rewritten EMAIL_OTP and OAUTH bullets match the existing detailed flow diagrams and curl examples further down the page. The Android and iOS platform encoding changes are correct: Android base64url-encodes the UTF-8 bytes for the JSON options string consumed by GetPublicKeyCredentialOption, and iOS uses Data(string.utf8) which is the standard Swift pattern for getting raw UTF-8 bytes.

No files require special attention.

Important Files Changed

Filename Overview
mintlify/snippets/global-accounts/authentication.mdx Documentation-only update: splits EMAIL_OTP/OAUTH summary bullets and adds explicit UTF-8 encoding steps to Android and iOS passkey snippets; changes are logically consistent with the detailed sections below.

Sequence Diagram

sequenceDiagram
  participant C as Client
  participant IB as Integrator backend
  participant G as Grid
  participant E as Email / OIDC

  note over C,G: EMAIL_OTP (updated flow)
  C->>IB: POST /my-backend/otp/challenge
  IB->>G: "POST /auth/credentials/{id}/challenge"
  G->>E: deliver OTP email
  G-->>IB: "200 { otpEncryptionTargetBundle }"
  IB-->>C: "{ otpEncryptionTargetBundle }"
  C->>C: generateClientKeyPair() (P-256 TEK)
  C->>C: "HPKE-encrypt { otp_code, publicKey } to encryptedOtpBundle"
  IB->>G: "POST /auth/credentials/{id}/verify { type: EMAIL_OTP, encryptedOtpBundle }"
  G-->>IB: "202 { payloadToSign, requestId }"
  C->>C: sign(payloadToSign, tekPrivateKey)
  IB->>G: Same POST + Grid-Wallet-Signature + Request-Id
  G-->>IB: 200 AuthSession (no encryptedSessionSigningKey)

  note over C,G: OAUTH (one-shot flow)
  C->>E: fresh OIDC token
  E-->>C: id_token
  IB->>G: "POST /auth/credentials/{id}/verify { type: OAUTH, oidcToken, clientPublicKey }"
  G-->>IB: "200 AuthSession { encryptedSessionSigningKey }"
Loading

Reviews (4): Last reviewed commit: "[grid] fix Global Account auth snippets" | Re-trigger Greptile

Comment thread mintlify/snippets/global-accounts/authentication.mdx
@DhruvPareek DhruvPareek force-pushed the dp/fix-passkey-registration-samples branch from bea498a to 167fdf7 Compare June 10, 2026 17:08
@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-auth-snippets branch from 9aa1eda to 2e284b5 Compare June 10, 2026 17:09
carsonp6
carsonp6 previously approved these changes Jun 10, 2026
@DhruvPareek DhruvPareek force-pushed the dp/fix-passkey-registration-samples branch from 167fdf7 to c14ff52 Compare June 10, 2026 18:25
@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-auth-snippets branch from 2e284b5 to 7da0598 Compare June 10, 2026 18:26

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

7da0598 is a pure rebase onto c14ff52. Approving based on @carsonp6's previous approval of 2e284b5.

@DhruvPareek DhruvPareek force-pushed the dp/fix-passkey-registration-samples branch 2 times, most recently from bf8ca05 to 2bf47ea Compare June 10, 2026 18:28
@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-auth-snippets branch from 7da0598 to 460893f Compare June 10, 2026 18:28

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

460893f is a pure rebase onto 2bf47ea. Approving based on @carsonp6's previous approval of 2e284b5.

@DhruvPareek DhruvPareek changed the base branch from dp/fix-passkey-registration-samples to graphite-base/566 June 10, 2026 18:33

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

460893f is a pure rebase onto 2bf47ea. Approving based on @carsonp6's previous approval of 2e284b5.

@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-auth-snippets branch from 460893f to d409949 Compare June 10, 2026 18:33

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

d409949 is a pure rebase onto 43b4727. Approving based on @carsonp6's previous approval of 2e284b5.

restamp-bot[bot]
restamp-bot Bot previously approved these changes Jun 10, 2026

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

d409949 is a pure rebase onto 43b4727. Approving based on @carsonp6's previous approval of 2e284b5.

@graphite-app graphite-app Bot changed the base branch from graphite-base/566 to main June 10, 2026 18:34
@graphite-app graphite-app Bot dismissed stale reviews from restamp-bot[bot] and carsonp6 June 10, 2026 18:34

The base branch was changed.

@DhruvPareek DhruvPareek force-pushed the dp/fix-global-account-auth-snippets branch from d409949 to f856ba9 Compare June 10, 2026 18:34

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

d409949 is a pure rebase onto 43b4727. Approving based on @carsonp6's previous approval of 2e284b5.

@restamp-bot restamp-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

f856ba9 is a pure rebase onto 43b4727. Approving based on @carsonp6's previous approval of 2e284b5.

@DhruvPareek DhruvPareek merged commit 536a5ac into main Jun 10, 2026
9 checks passed

Copy link
Copy Markdown
Contributor Author

Merge activity

@DhruvPareek DhruvPareek deleted the dp/fix-global-account-auth-snippets branch June 10, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants