Q40: Compare API Keys with OAuth 2.0 Bearer Access Tokens.
- API Keys: Static, long-lived secret tokens identifying an application project or organization. Passed via query parameters or headers. Primary use case: Server-to-server billing, rate limiting, and project usage tracking.
- OAuth Bearer Tokens: Short-lived dynamic security tokens issued on behalf of a specific user or client session. Primary use case: Delegated access control, fine-grained user permissions, and user-facing API access.
Key Takeaways
API Keys identify application projects; Bearer Tokens authorize specific user/client sessions.
Do not use static API Keys for user authorization in client-facing frontend applications.