Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Custom URL Scheme Redirect
Cyber Security

Custom URL Scheme Redirect

← Back to Glossary
By NHI Mgmt Group Updated October 31, 2026 Domain: Cyber Security

A custom URL scheme redirect is a desktop OAuth callback pattern that returns the browser to an installed application through a scheme such as app-auth://callback. It replaces the usual HTTP redirect and depends on the operating system registering the scheme so the app can receive the authorization response.

What a custom URL scheme redirect is

A custom URL scheme redirect is an OAuth callback pattern used by installed desktop or mobile applications when the browser returns the authorization response to a registered app-specific scheme rather than an HTTPS endpoint. The operating system routes the callback to whichever application has claimed the scheme, so the security of the registration and the exact redirect handling are central to the pattern.

Why custom URL scheme redirects are used

This pattern exists because native apps often cannot host a stable public web callback endpoint in the same way a server application can. A custom scheme gives the app a way to receive the authorization response locally, which can simplify sign-in flows and avoid exposing a local listener or embedded browser callback surface. It is most useful when paired with platform-native browser flows and strong redirect validation, as described in the OAuth for Native and Mobile Apps Guide.

The trade-off is that the operating system becomes part of the trust chain. If another app claims the same scheme, or if the redirect is accepted too loosely, the callback can be intercepted or confused. That makes scheme registration, exact matching, and app ownership of the callback path materially more important than they are in ordinary web redirects.

How custom URL scheme redirects can be abused

The main security concern is that custom schemes are not globally unique in the same way as a controlled HTTPS origin. If an attacker can register the same scheme, or if the app accepts a weakly validated callback, they may be able to capture authorization codes, tokens, or other response data. The broader redirect abuse pattern is covered in the Open Redirect Guide, and the app-specific deep-link side of the problem is covered in the Mobile Deep Link and App Link Security Guide.

These failures are especially dangerous because they can turn a legitimate sign-in redirect into a credential or session theft opportunity. The attacker does not need to break the OAuth protocol itself; they only need to win control of the callback destination or exploit a permissive redirect parser. That is why exact redirect URI matching and callback ownership are considered part of the security boundary, not a minor implementation detail.

How to validate and harden the redirect flow

Practitioners should treat the redirect as an authentication-sensitive interface and verify it end to end: the registered scheme, the callback path, the app association, and the OAuth client configuration. On mobile and desktop, the safest implementations use platform browser components and prefer claimed HTTPS or loopback redirects where the platform and product design allow them, as outlined in the OAuth for Native and Mobile Apps Guide. Where a custom scheme must remain in use, the app should accept only the expected callback shape and reject ambiguous or malformed responses.

Operationally, teams should also review app installation and scheme registration behavior across supported operating systems, because the exact risk can vary by platform. A redirect design that is tolerable on one platform can become brittle on another if the OS permits easier scheme hijacking or looser association rules. That is why secure deep-link handling and OAuth callback handling need to be reviewed together rather than as separate concerns.

What to do after suspected abuse or interception

If there is evidence that a custom scheme redirect may have been intercepted, treat the event like potential OAuth response compromise. Revoke the affected authorization grant, review token issuance and session creation, and determine whether the authorization code or access token could have been exposed before normal user interaction completed. If the app uses long-lived refresh tokens or other persistent credentials, those should be rotated or invalidated as part of containment.

Post-incident review should focus on whether the issue was caused by scheme collision, weak redirect validation, a vulnerable deep-link implementation, or a broader mobile OAuth design flaw. The practical goal is not only to fix the immediate callback path, but also to confirm that no other redirect channel in the application can be abused in the same way.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 addresses the attack and risk surface, while OWASP ASVS, NIST SP 800-63 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV10 — OAuth and OIDCCustom scheme redirects are part of native OAuth/OIDC callback handling.
Recommendation — Validate redirect URI handling and callback processing for native OAuth flows.
NIST SP 800-63Digital Identity GuidelinesCovers secure OAuth-style native app sign-in and phishing-resistant browser-based flow choices.
Recommendation — Prefer browser-based native app flows and enforce strong redirect handling.
OWASP API Security Top 10API2 — Broken AuthenticationA hijacked callback can compromise the authorization response and downstream token handling.
Recommendation — Protect authorization responses so intercepted callbacks cannot become valid sessions.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementAuthorization codes, tokens, and refresh tokens created by the flow depend on secure credential lifecycle handling.
AC-4 — Information Flow EnforcementRedirect handling is an information-flow boundary that must only deliver data to the intended app.
Recommendation — Rotate or revoke exposed tokens and enforce secure lifecycle handling for OAuth credentials. Enforce strict callback routing so authorization data reaches only the intended application.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org