Why use OAuth clients
Use OAuth when your app needs to act on behalf of individual Lovable users. For example, an MCP client without a preconfigured Lovable connection can use a custom OAuth client to connect to the Lovable MCP server on each user’s behalf, without asking them to share an API key or password. You choose the scopes your client can request, and each user authorizes the app. OAuth scopes do not expand the user’s existing access to projects or workspaces. For a script that manages a single workspace without asking each user to connect, see Workspace API keys, available on Business and Enterprise plans.Common use cases and example apps
Choose scopes based on what your app needs to do. These examples show scopes to consider for common integrations.offline if your app needs refresh tokens to keep the connection working after the initial access token expires.
For an MCP client that supports custom OAuth credentials, register an OAuth client with the callback URL it provides, then configure it with your client ID and secret. It can connect to the Lovable MCP server at https://mcp.lovable.dev on behalf of each user who signs in and authorizes access.
Prerequisites
Before you register a client, make sure you have:- A workspace on any plan for non-sensitive scopes. Sensitive scopes require Business or Enterprise.
- The owner or admin role in that workspace.
- An app or integration that supports the OAuth authorization code flow with PKCE using S256. PKCE ties each authorization request to its token exchange.
- A redirect URI, also called a callback URL, that your app uses to receive the authorization response.
- For a Web server client, a secure backend or connector configuration that can store the client secret and exchange authorization codes for tokens.
Register an OAuth client
Register your app in the workspace that will own and manage its client credentials.Open OAuth client settings
Choose the application type
Name your client
Project reporting dashboard.Add redirect URIs
https://example.com/oauth/callback. Redirect URIs must use https. During development you can also use http with localhost, 127.0.0.1, [::1], or a .localhost address.Click Add redirect URI if your integration uses additional callback URLs. Each client can have up to 10.Choose scopes
Register and save your credentials
Available scopes
Scopes define which data your app can read and which actions it can take on a user’s behalf. Registering a scope allows your app to request it. The app must also include it in the authorization request. Non-sensitive scopes are available on all plans. Sensitive scopes require a Business or Enterprise workspace.Connect your app
Give your integration the client ID, the client secret for a Web server client, the registered callback URL, and the required scopes. Configure it to use the authorization code flow with PKCE using S256. Users sign in to Lovable and authorize the requested scopes. Lovable returns an authorization code to your callback URL, and your app exchanges it for tokens using the PKCE verifier and, for a Web server client, the client secret. Your app uses the access token to act on the user’s behalf, for example as a bearer token for the Lovable API. Use an OAuth or OpenID Connect library to handle PKCE, validate the authorization response and any ID token used for sign-in, and store tokens securely. For refresh tokens, includeoffline in both the client’s registered scopes and the authorization request.
OAuth endpoints
Use these production endpoints for a custom integration:Manage OAuth clients
After registration, open a client’s details to request verification, update its settings, replace its secret, or delete the client.Request verification from Lovable
To protect users, OAuth clients registered with sensitive scopes need verification from Lovable. Until a client is verified, users see a warning when authorizing it. To request verification, open your client from Workspace settings → API keys & OAuth → OAuth clients, then click Request approval next to Verification. When Lovable verifies your client, the badge shows Verified by Lovable and the warning no longer appears. If Lovable has not decided within five days, the request expires and you can request approval again. If Lovable denies the request, the badge shows Approval denied. You can change the client and request approval again.Edit a client
Open the client, click Edit client, update its name, redirect URIs, or scopes, and click Save changes. The client ID and secret stay the same. Edits to a verified client that include sensitive scopes create a review request. The current configuration and verified status remain active while Lovable reviews the proposal. Review the proposed settings under Pending changes on the client’s details page. You can edit a pending verification request or change request. Edit client opens the proposed settings, and saving replaces the pending review with a new request. The current settings stay active until approval, even if the revised proposal removes all sensitive scopes. Use Withdraw request if you want to cancel the request. Editing and withdrawal are unavailable once Lovable starts applying an approval. When no review is pending, edits to unverified clients or changes that leave only non-sensitive scopes apply immediately and reset verification. Clients with only non-sensitive scopes do not need to request verification again. If you add a scope and your app starts requesting it, users who already connected are asked to authorize it the next time they sign in.Generate a new client secret
A Web server client has one active secret. Use this if you lose it or need to replace it.- Open the client and click Generate new secret under Client secret.
- Confirm Generate new secret.
- Copy the new secret and update every app or connector configuration that uses this client.
- Test sign-in and token refresh with the updated configuration.
Delete a client
Open the client’s menu in the list, or the client’s details, and click Delete client, then confirm. Apps that use the client can no longer sign users in with Lovable, and existing connections stop working. Deleting a client cannot be undone.Limitations
Keep these registration limits and supported authorization flows in mind when planning your integration.- You can register up to 20 OAuth clients per workspace. Delete an unused client before registering another when you reach this limit.
- Clients support the authorization code flow with PKCE and optional refresh tokens. The client credentials grant for unattended access without a user is not supported.
- Only the eight scopes listed on this page are available.
FAQ
Which plans and roles can manage OAuth clients?
Which plans and roles can manage OAuth clients?
Is this the same as adding Google sign-in to my app?
Is this the same as adding Google sign-in to my app?
Can users connect before Lovable verifies my client?
Can users connect before Lovable verifies my client?
Can I view my client secret again?
Can I view my client secret again?
Does selecting a scope automatically give my app access?
Does selecting a scope automatically give my app access?
Troubleshooting
I cannot see OAuth clients in settings
I cannot see OAuth clients in settings
Sign-in works, but my app does not receive a refresh token
Sign-in works, but my app does not receive a refresh token
offline in the client’s scopes and include it in your app’s authorization request. Users who already connected must authorize the updated request the next time they sign in.