OAuth ROPC: why the password grant must be retired
Understand how OAuth ROPC exposes user passwords, why RFC 9700 prohibits it, and how to plan a safe replacement.
OAuth ROPC: why the password grant must be retired
The OAuth 2.0 Resource Owner Password Credentials Grant (ROPC) is an old flow in which an app collects a user's password and submits it to the authorization server to obtain a token. RFC 9700, the current OAuth Security Best Current Practice, says this grant MUST NOT be used. New systems should let users authenticate directly with the authorization server through Authorization Code; existing ROPC apps should move to a safe alternative supported by their provider.
What is the ROPC flow?
In a typical OAuth flow, the app sends the user to the authorization server, where the user signs in and approves access. With ROPC, the app provides the login screen itself and collects the user's username and password. It then includes the password in a token request to the authorization server, which returns an access token if the credentials are valid.
RFC 6749 represents this with grant_type=password. The “resource owner” is the user of a protected resource; the “client” is the app seeking API access for that user. The defining difference is that the app handles the password.
Why must it not be used?
ROPC exposes the user's login secret to the app and its components, not only to the authorization server. Every additional place where the password passes or is stored—app logs, error collection, keyboard handling, network layers, or third-party SDKs—creates another possible leakage path. Even a well-intentioned app trains users to enter their password into the app rather than the authorization server.
It also fits poorly with sign-in that needs further user interaction, such as multi-factor authentication. Authentication tied to a specific web origin, such as passkeys or WebAuthn, is difficult to implement through a generic ROPC form. For these reasons RFC 9700 marks ROPC MUST NOT. This is a prohibition in current OAuth security guidance, not merely a preference to avoid it when convenient.
What should replace it?
Most user-facing apps should use Authorization Code. Users authenticate with the authorization server rather than the app, and the server returns a one-time authorization code instead of a token. The app exchanges the code at the token endpoint. Browser and mobile apps that cannot safely store a client secret should use PKCE as well.
Migration is more than moving the login form to another screen. Check which flows the existing authorization server supports, the app type, user authentication requirements, redirect URIs, and session handling.
| Use case | Direction to consider |
|---|---|
| User signs in through a browser or mobile app | Prefer Authorization Code with PKCE. |
| A service accesses its own resources without a user | Do not collect a user's password; consider Client Credentials with suitable client authentication. This does not grant authority on behalf of a user. |
| A legacy app still uses ROPC | Check the provider's official replacement and migration schedule; first remove paths that store or log passwords. |
| The authorization server supports only ROPC | Ask the provider about modern authorization flows before connecting a new system. Do not store user passwords as a workaround. |
Migrate an existing ROPC implementation in stages
Search code and configuration for `grant_type=password`. Check whether request or response bodies are captured by proxies, application logs, or error-tracking tools. Never copy real passwords or tokens into diagnostic materials.
Identify whether the app serves users or performs server-to-server work. For user sign-in, assess Authorization Code with PKCE; for app-owned permissions, assess a provider-supported server-to-server method.
Read the authorization server's official documentation for supported flows, client registration, MFA and passkey requirements, and redirect-URI rules.
Test the new flow in a test environment. Check sign-in, cancellation, denial, MFA, account recovery, and session expiry. Request minimum permissions and handle tokens safely.
Deploy in stages and verify that `grant_type=password` requests disappear. If the migration fails, do not log user passwords; follow the authorization server's safe recovery procedure.
Key takeaway
ROPC is an OAuth flow in which the user gives a password to the app and the app forwards it to the authorization server. It expands password exposure and does not fit modern multi-factor or origin-bound authentication. RFC 9700 prohibits its use. Plan user sign-in around Authorization Code with PKCE, using the provider's supported migration path.
References
[RFC 6749 §4.3 — Resource Owner Password Credentials Grant](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.3)
[RFC 9700 §2.4 — Resource Owner Password Credentials Grant](https://www.rfc-editor.org/rfc/rfc9700.html#section-2.4)
[RFC 9700 §2.1.1 — Authorization Code Grant](https://www.rfc-editor.org/rfc/rfc9700.html#section-2.1.1)