Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Registering an OAuth app means creating an application identity in an identity provider’s developer console before your software can request user authorization. You normally provide an app name, choose the platform and account audience, register an exact redirect URI, configure consent and scopes, then receive a client ID and—only for confidential clients—a secret, certificate, or federated credential. Registration does not grant API access by itself; users, scopes, consent, and token policies still control what your app can do.

What you need before opening a provider console

  • Your application type: web server, single-page application (SPA), mobile or desktop app, or device-flow client. This determines where credentials can safely live and which redirect mechanism is valid.
  • An exact callback endpoint: record the scheme (https in production), host, port, path, and any required trailing slash. You will register this value and send the identical value in the authorization request.
  • An account and project: some providers require a cloud project or organization context before you can create credentials.
  • A scope plan: list the smallest permissions your feature needs. Broad scopes create more consent friction and may trigger provider review.
  • A secret-storage plan: confidential-client secrets, certificates, federated-credential settings, and downloaded credential files belong in a secret manager or protected environment variable, never in a public repository.

Public metadata such as an app name, homepage, description, and consent-screen text may be shown to users. Treat every registration field as public unless the provider explicitly marks it secret.

GitHub: register an OAuth App

  1. Sign in to GitHub and open Settings → Developer settings → OAuth apps → New OAuth App. If this is your first app, GitHub may show Register a new application.
  2. Enter a public application name, the full homepage URL, an optional description, and the authorization callback URL.
  3. Save the registration. GitHub then provides the client identifier and lets you generate the client secret. Keep the secret outside source control.
  4. If your client uses GitHub’s device authorization flow, enable the optional Device Flow setting during registration.

GitHub permits up to 10 callback URLs. Register only the URLs you actually operate; each is part of the boundary that prevents an authorization response being sent to an attacker.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the GitHub flow uses the registration

Send the user to GitHub’s authorization endpoint with your client ID, the registered callback URL, requested scopes, and a state value. GitHub redirects back with a temporary authorization code. Your server exchanges that code for tokens, then calls the API with the user’s access token. Validate state and handle an authorization denial as well as success.

Google: create an OAuth 2.0 client

  1. Create or select the Google Cloud project that will own the integration.
  2. Configure the project’s OAuth consent experience. Set the audience and publishing or testing status required for your users, and add only the scopes your application needs.
  3. Open the credentials area and create an OAuth 2.0 Client ID for the correct application type. Choosing a web client for a SPA, or a mobile client for a server application, produces the wrong security model.
  4. For a server-side application, add the exact authorized redirect URI, including scheme, host, path, port, and slash details.
  5. Download or copy the client configuration. Google identifies the runtime values as CLIENT_ID, CLIENT_SECRET, and REDIRECT_URI.

Keep the downloaded client_secret.json outside a shared source tree. Put its values in a secret manager or deployment secret store and grant access only to the process that performs the code-to-token exchange.

Google consent and testing considerations

Consent configuration is separate from credential creation. A client ID identifies your application, but the consent screen, audience, scopes, and user authorization determine whether a request succeeds and what data the resulting token can access. Test with the account types and redirect hostnames you will support in production.

Microsoft Entra ID: register an app and credentials

  1. In the Microsoft Entra admin center, open App registrations and select New registration.
  2. Choose the supported account type: accounts in this organizational directory (single tenant), accounts in any organizational directory (multitenant), personal Microsoft accounts, or the combination appropriate to your product.
  3. Complete registration. The Overview page shows the Application (client) ID and Object ID. The client ID identifies the app; the object ID identifies its directory object.
  4. Open Authentication, add the platform configuration (web, single-page application, mobile/desktop, or another supported platform), and enter the redirect URI for that platform.
  5. For a confidential client, open Certificates & secrets and add a certificate, client secret, or federated credential. Copy a newly displayed secret immediately if Entra shows it only once.

Microsoft states that client secrets are less secure than certificate credentials, recommends certificates or federated credentials for production, limits client-secret lifetime to 24 months or less, and recommends a lifetime below 12 months. Set a rotation owner and replace credentials before expiry; do not wait for a failed deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Redirect URI rules that prevent “redirect_uri rejected” errors

The redirect URI is not a descriptive hint. It is a registered allow-list entry and a security control. Providers commonly compare the value in the authorization request with the registered value, so a one-character difference can fail.

Check these characters and conditions

  • Use the same scheme: http for a provider-approved local-development exception, https for production.
  • Match hostnames exactly, including www, subdomains, and letter case where the provider applies strict comparison.
  • Match the port, path, encoding, and trailing slash.
  • Do not substitute a frontend route for the backend endpoint that actually receives the code.
  • Send the same URI in the authorization request that you registered; do not construct it differently in different environments.
  • Register each legitimate environment separately when the provider requires exact entries. Never add a wildcard unless the provider explicitly supports it and you understand the risk.

A reliable debugging method

  1. Copy the redirect_uri value from the failing authorization URL, decode it once, and compare it character by character with the console entry.
  2. Confirm that the client ID belongs to the same provider project or tenant as the redirect registration.
  3. Confirm that the selected application type matches the flow (web, SPA, mobile, desktop, or device).
  4. Check proxy settings: an application behind a load balancer may generate http internally while users access https. Configure trusted forwarded headers or set the public base URL explicitly.
  5. Retry with a newly generated authorization URL and a fresh state value.

Client ID, client secret, certificate, and token: what each value does

Value Purpose Where it belongs
Client ID Public identifier for the registered application Authorization URL and application configuration; exposure alone does not authenticate the app
Client secret Credential for a confidential client during token exchange Server-side secret manager or protected environment variable; never browser code or a repository
Certificate or federated credential Stronger confidential-client authentication option Protected key store, workload identity, or federation configuration
Access token Short-lived authorization to call APIs for granted scopes Runtime memory or encrypted token storage, according to provider policy

A registration creates configuration and credentials; it does not automatically approve scopes or give your users’ data to the application. Authorization, consent, review, and token issuance remain separate steps.

Run the authorization-code flow safely

  1. Generate a cryptographically random state value and, when supported, a nonce. Store the expected values in the user’s server-side session.
  2. Redirect the user to the provider with the client ID, exact redirect URI, requested scopes, state, and provider-specific parameters.
  3. At the callback, reject missing or mismatched state and handle an error response such as user denial.
  4. Exchange the one-time authorization code over a server-to-server TLS connection. Send the registered redirect URI again if the provider requires it.
  5. Validate the token response, store refresh tokens only in protected storage, and call APIs with the access token and only the granted scopes.
  6. Handle expiration and revocation. Refresh or reauthorize according to the provider’s rules, and revoke or rotate credentials when a secret may have leaked.

Common failures and fixes

Symptom Likely cause Fix
redirect_uri_mismatch or rejected redirect URI differs by scheme, host, port, path, encoding, or slash Copy the exact request value into the provider’s registered entry and make your application emit one canonical public URI.
Invalid client Wrong client ID, wrong tenant/project, expired secret, or secret copied incorrectly Verify the registration context, replace the credential if needed, and load it from the deployment secret store.
Consent or scope error Scope not enabled, audience misconfigured, or provider review required Reduce scopes, correct consent settings, and test with an account allowed by the project’s audience.
Callback works locally but not in production Proxy-generated scheme or hostname differs from the public URL Configure forwarded headers and register the production callback separately.
Code exchange fails after a retry Authorization codes are short-lived and single-use Start a new authorization request; do not reuse a code captured from an earlier callback.
Secret appears in logs or a repository Credential was treated as ordinary configuration Revoke or rotate it immediately, remove it from history where possible, and move the replacement into secret management.

Operational checklist before launch

  • Confirm every production callback uses HTTPS and is registered for the correct client.
  • Verify the account audience, consent text, scopes, and provider review status.
  • Keep client IDs separate from secrets and certificates; restrict production secret access.
  • Use a rotation calendar. Microsoft client secrets must not exceed 24 months and are recommended for less than 12 months.
  • Log provider error codes and correlation IDs without logging authorization codes, secrets, or access tokens.
  • Test denial, expired-code, revoked-consent, expired-secret, and callback-unavailable paths.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to capture documentation, consent screens, or OAuth redirect pages rather than build the OAuth flow itself, ScreenshotNeo returns a screenshot or PDF from one request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether it was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

Using cURL (see the ScreenshotNeo API documentation):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

FAQ

Can I use one OAuth registration for development and production?

Only when the provider and your security model permit it. Separate registrations usually make callback allow-lists, secrets, consent settings, and rotation safer to manage.

Should a SPA have a client secret?

A browser-delivered application cannot keep a secret confidential. Choose the provider’s SPA or public-client configuration and use the flow and protections it specifies rather than embedding a server secret.

What happens if a user changes permissions later?

The token’s granted scopes may differ from what you requested. Handle insufficient-scope responses and send the user through consent again only for the missing permission.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I rename an OAuth app after registration?

Usually the provider lets you change public metadata, but changing a name does not create a new client identity. Check the provider console’s edit controls and update consent text if users see the old name.

Is a client secret the same as an API key?

No. A client secret authenticates a confidential OAuth client during a protocol exchange. An API key generally identifies a calling project or application and follows different issuance and revocation rules.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.