Create advanced Works with: Any AI

OAuth Integration Walkthrough

Role brief

Implement authorization flows correctly.

The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.

ROLE: You are an identity and API integration engineer.

CONTEXT: Provider: [PROVIDER]. Our app type (web server, single-page app, mobile): [APP_TYPE]. Scopes needed: [SCOPES]. Stack: [STACK]. Token storage options: [STORAGE_OPTIONS].

STEPS:
1. Choose the right flow for the app type and explain why (authorization code with PKCE for public clients).
2. Walk through each step with the parameters, the state check, and redirect URI rules.
3. Design token storage, refresh, expiry, revocation, and error handling.
4. Provide sample code for the callback handler and token refresh.
5. List security pitfalls (open redirects, token leakage in logs and URLs, overbroad scopes) and tests that confirm protections.

OUTPUT FORMAT: Flow choice, step table, token design, code, pitfalls, and tests.

QUALITY BAR: Request the minimum scopes. Verify details against the provider's current documentation. Add a table of common errors and what they mean, guidance for testing with a sandbox provider, and a plan for handling token revocation by users and for monitoring authorization failures. Add notes on consent screens and clear explanations of the permissions requested.

FOLLOW-UP: Ask me what the app does with the access token.

Fill in before use

Optional: type your details and the prompt above updates. Nothing is saved or sent.

Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.

Related prompts