Definition

OAuth

OAuth is an open authorization framework that allows users to grant third-party applications limited access to their accounts on other services, such as Google or GitHub, without sharing their passwords directly with the third-party application.

Understanding OAuth

OAuth powers the "Sign in with Google" and "Sign in with GitHub" buttons seen on countless web applications. Instead of creating a new username and password for every service, users can authenticate through a provider they already trust. The OAuth flow redirects the user to the provider's login page, the user grants permission, and the provider sends an authorization code back to the application.

For vibecoders, OAuth is attractive because it offloads the complexity of password management and account security to established providers. Many AI coding tools can generate OAuth integration code with popular providers. However, the OAuth flow involves multiple redirects, callback URLs, token exchanges, and error states, each of which can go wrong.

Testing OAuth flows requires verifying the complete cycle: initiating the login, completing the provider authentication, handling the callback, and establishing the local session. Testers should also check what happens when the user denies permission, when the callback URL is incorrect, and when the provider returns an error. These failure scenarios are frequently not handled in AI-generated OAuth code.

Example usage

Sign in with Google worked on the first try, but if the user denied permission and then tried again, the app got stuck in an infinite redirect loop.

Related terms

Learn more