Security

    OAuth 2.0

    An authorization framework that enables applications to obtain limited access to user accounts on third-party services.

    Share

    Key Takeaways

    • OAuth 2.0 enables 'Sign in with Google/GitHub' by delegating authentication to trusted providers.
    • PKCE (Proof Key for Code Exchange) is required for single-page apps and mobile apps. Never use Implicit Flow.
    • OAuth handles authorization (what can you access). OpenID Connect (OIDC) adds authentication (who are you).

    OAuth 2.0 Flows Explained

    FlowUse CaseSecurity Level
    Authorization Code + PKCESPAs, mobile appsHighest (recommended for all new apps)
    Authorization CodeServer-side web appsHigh (requires server-side secret)
    Client CredentialsMachine-to-machine APIsHigh (no user involved)
    Device CodeSmart TVs, CLI toolsModerate (user authorizes on separate device)
    Security Warning

    Never use the Implicit Flow (deprecated). Never store tokens in localStorage (XSS vulnerable). Use httpOnly cookies for token storage in web applications. Implement token refresh rotation to limit the impact of token theft.

    Frequently Asked Questions

    Need Help With Implementation?

    Our team specializes in implementing the solutions described in this glossary.

    Get in Touch