Application architectures
How browser, native, backend and service-to-service applications use OAuth safely.
Start with Server-rendered web applications
- Server-rendered web applicationsSee why a website backend makes a strong OAuth client: tokens stay encrypted on the server, sessions and connections end separately, and background jobs refresh safely.
- Browser applicationsRun the authorization code flow in JavaScript as a public client, and see what cross-origin requests, token storage, refresh rules, and injected script mean for it.
- Backends for frontendsMove a browser application's tokens to a small backend, compare three designs, and protect the backend's cookie-based endpoints against cross-site request forgery.
- Native applicationsLearn why mobile and desktop apps sign in through the system browser, redeem codes as public clients with PKCE, and keep refresh tokens in platform secure storage.
- Command-line toolsCompare ways a command-line tool can obtain access, from a loopback redirect to personal access tokens, and keep its tokens out of logs, arguments, and history.
- Service-to-service accessDecide how one API calls another on a user's behalf, why forwarding tokens and trusting headers fail, and how services prove their own identity without long-lived secrets.