Device Code Flow Playground
This playground implements a complete Device Code Flow. Request a device code, authenticate at the verification URL (simulating the "second screen"), and receive a signed JWT. Useful for testing CLI tools, IoT device auth, and Snowflake External OAuth integrations.
Solve the captcha to activate the API for your session (10 minutes). This prevents bots from abusing the demo endpoints.
Use these scripts to interact with the API programmatically. The session token from the captcha is required for all requests. Your session token: --
Complete device code flow — request, poll, receive token. Requires: pip install requests
Validate a received token against JWKS or a public key. Requires: pip install PyJWT cryptography
Quick test with curl.
Choose how the JWT will be signed. Server mode uses the blog's RSA key -- validate tokens against the JWKS endpoint. Client mode generates keys in your browser for fully offline signing.
Tokens are signed by the blog's RSA key. Validate against:
Generating RSA-2048 key pair in your browser...
Click below to request a device code. You'll get a user code and a link to the verification page. Open the link in a new tab (or on your phone) and enter the code there.
Open the verification URL and enter this code:
Exchange your bearer token for a demo AES encryption key. This demonstrates a protected API endpoint that validates the JWT before returning sensitive material.
For testing and demos only. The server's RSA key regenerates on restart. Device codes expire after 10 minutes. Tokens expire after 1 hour. No data is stored permanently. In production, use a real Identity Provider (Okta, Entra ID, Auth0) for device code flows.
Articles that use this playground
- How OAuth 2.0 and OpenID Connect Actually WorkA visual explanation of OAuth 2.0 and OpenID Connect: who the parties are, how the authorization code flow with PKCE, client credentials and device code flows work, what …
- Credential Vending for AI Agents: a Snowflake OAuth and PAT Toolkit for MCP AuthenticationThe core challenge of AI agents: passing the human user's identity through to the database or data platform. The pattern is credential vending: exchange the user's …
- How JWT Tokens Actually Work, with Snowflake External OAuth as the Worked ExampleA visual, hands-on explanation of JSON Web Tokens: what they contain, how signing works, why they expire, and how a platform that accepts external OAuth tokens verifies …