{
    "api_version": "1",
    "kind": "dse_post",
    "self": "https://update.dsesecurity.com/api/v1/posts/oauth-exact-redirect-matching-and-pkce/",
    "item": {
        "id": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/",
        "slug": "oauth-exact-redirect-matching-and-pkce",
        "url": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/",
        "alternate_urls": {
            "markdown": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce.md",
            "json": "https://update.dsesecurity.com/api/v1/posts/oauth-exact-redirect-matching-and-pkce/"
        },
        "title": "Require exact redirect matching and PKCE in OAuth authorization-code flows",
        "summary": "OAuth authorization-code flows need exact redirect URI matching and correctly enforced PKCE. Treat both as testable protocol controls across every client and authorization server.",
        "format": {
            "slug": "guide",
            "name": "Guide"
        },
        "priority": {
            "slug": "important",
            "name": "Important"
        },
        "featured": false,
        "image": {
            "theme": "identity-cloud",
            "label": "Identity & cloud",
            "alt": "Governed cloud identity system with connected service and lifecycle nodes.",
            "card_url": "https://update.dsesecurity.com/assets/editorial/identity-cloud-card.webp?v=1.8.20",
            "hero_url": "https://update.dsesecurity.com/assets/editorial/identity-cloud-hero.webp?v=1.8.20",
            "social_url": "https://update.dsesecurity.com/assets/editorial/identity-cloud-social-v2.jpg?v=1.8.20",
            "width": 2400,
            "height": 1350
        },
        "topics": [
            {
                "slug": "cybersecurity",
                "name": "Cybersecurity",
                "url": "https://update.dsesecurity.com/topic/cybersecurity/"
            },
            {
                "slug": "it",
                "name": "IT",
                "url": "https://update.dsesecurity.com/topic/it/"
            },
            {
                "slug": "microsoft-365-identity",
                "name": "Microsoft 365 & Identity",
                "url": "https://update.dsesecurity.com/topic/microsoft-365-identity/"
            }
        ],
        "author": {
            "name": "DSE Security Editorial Team",
            "url": "https://update.dsesecurity.com/#editorial-team",
            "type": "Organization"
        },
        "publisher": {
            "name": "Detection Systems & Engineering",
            "url": "https://dsesecurity.com/"
        },
        "published_at": "2026-08-25T21:34:05+00:00",
        "modified_at": "2026-08-26T13:27:47+00:00",
        "reviewed_on": "2026-08-25",
        "reading_minutes": 3,
        "word_count": 620,
        "potentially_affected": "Organizations operating, developing, integrating, or procuring OAuth 2.0 clients and authorization servers that use browser redirects and the authorization-code grant.",
        "dse_recommendation": "Inventory every OAuth redirect flow, enforce exact registered URI comparison, require correctly bound PKCE where applicable, and test rejection paths rather than accepting a successful login as proof.",
        "primary_source": {
            "name": "RFC 9700 — Best Current Practice for OAuth 2.0 Security",
            "url": "https://www.rfc-editor.org/rfc/rfc9700.html",
            "published_on": null,
            "authority": "www.rfc-editor.org"
        },
        "publishing_principles": "https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/",
        "usage_info": "https://update.dsesecurity.com/usage/",
        "copyright_notice": "Copyright © 2026 Detection Systems & Engineering. All rights reserved.",
        "content_html": "<p><strong>Bottom line:</strong> an OAuth login that succeeds does not prove the authorization-code flow is safely bound to the intended client. Exact redirect URI comparison and correctly enforced Proof Key for Code Exchange (PKCE) close different substitution and code-injection paths, and both need negative testing.</p>\n<h2>Source fact: what the OAuth security BCP requires</h2>\n<p><a href=\"https://www.rfc-editor.org/rfc/rfc9700.html\" target=\"_blank\" rel=\"noopener noreferrer\">RFC 9700</a>, published as an Internet Best Current Practice in January 2025, updates OAuth 2.0 security guidance using experience with deployed systems. For redirect-based flows, it says authorization servers must compare a requested redirect URI with the pre-registered value using exact string matching, except for the permitted handling of localhost port numbers for native applications. It also says clients and authorization servers must not expose open redirectors that forward a browser to an arbitrary URI from a parameter.</p>\n<p>For authorization-code flows, the RFC requires public clients to use PKCE and recommends it for confidential clients. Authorization servers must support PKCE, enforce the submitted code verifier when a challenge was present, and prevent downgrade behavior. The RFC identifies <code>S256</code> as the current challenge method that does not expose the verifier in the authorization request. A PKCE challenge or permitted OpenID Connect nonce must be transaction-specific and securely bound to the client and user agent that started the transaction.</p>\n<h2>What the source does not establish</h2>\n<p>Exact redirect matching and PKCE do not prove the client, browser, authorization server, resource server, or registered application is trustworthy. They do not correct excessive scopes, missing audience checks, insecure refresh-token handling, compromised endpoints, malicious app registration, or authorization decisions made after token issuance.</p>\n<p>The RFC defines protocol practice, not a product certification. Provider behavior, native-app redirect mechanisms, reverse proxies, software libraries, and migration constraints must be checked for the exact implementation. Changing redirect registration or PKCE enforcement can interrupt production clients if their real behavior is not known.</p>\n<h2>Applicability questions</h2>\n<ul>\n<li>Which clients use authorization code, implicit, device, client-credentials, or another flow?</li>\n<li>What exact redirect URI does each deployed version send, and where is it registered?</li>\n<li>Are wildcard, pattern, alternate-scheme, proxy-rewritten, or environment-shared redirects accepted anywhere?</li>\n<li>Does every public client create a fresh high-entropy verifier and use <code>S256</code> for each transaction?</li>\n<li>Does the authorization server reject a missing, altered, reused, or incorrectly bound verifier?</li>\n<li>Which legacy libraries or brokers would fail if the current BCP were enforced?</li>\n</ul>\n<h2>DSE recommendation: test the complete redirect and code binding</h2>\n<p><em>The following steps are DSE recommendations based on the cited source.</em></p>\n<p>Build a register of authorization servers, client identifiers, owners, client types, flows, registered redirect URIs, real redirect URIs, PKCE methods, libraries, and production dependencies. Confirm those values from configuration and observed transactions rather than an architecture diagram alone.</p>\n<p>For each authorization-code client, test the approved exact redirect and then deliberately change the scheme, host, port where no exception applies, path, case, encoding, query, and suffix. The authorization server should reject every unregistered value. Test client and server endpoints for open-redirect behavior. Exercise PKCE with the correct verifier, an incorrect verifier, a missing verifier, a reused verifier, a downgraded challenge method, and a token request that supplies a verifier when no challenge began the transaction.</p>\n<p>Move incompatible clients through an owned migration rather than leaving a broad exception. Record the business dependency, affected versions, compensating restrictions, deadline, and retirement evidence. Coordinate changes across application, identity, API, and monitoring owners, with rollback that does not silently restore unsafe matching.</p>\n<h2>Verification and evidence</h2>\n<p>Retain the client register, authorization-server configuration, registered redirect export, library and version inventory, redacted protocol traces, negative-test results, change approvals, exceptions, and production monitoring. Evidence should show both the accepted transaction and the rejected mutations without preserving usable authorization codes, tokens, client secrets, or PKCE verifiers.</p>\n<h2>Official references</h2>\n<ul>\n<li><a href=\"https://www.rfc-editor.org/rfc/rfc9700.html\" target=\"_blank\" rel=\"noopener noreferrer\">RFC 9700 — Best Current Practice for OAuth 2.0 Security</a> — Internet Engineering Task Force; published January 2025</li>\n</ul>",
        "content_text": "Bottom line: an OAuth login that succeeds does not prove the authorization-code flow is safely bound to the intended client. Exact redirect URI comparison and correctly enforced Proof Key for Code Exchange (PKCE) close different substitution and code-injection paths, and both need negative testing.\nSource fact: what the OAuth security BCP requires\nRFC 9700, published as an Internet Best Current Practice in January 2025, updates OAuth 2.0 security guidance using experience with deployed systems. For redirect-based flows, it says authorization servers must compare a requested redirect URI with the pre-registered value using exact string matching, except for the permitted handling of localhost port numbers for native applications. It also says clients and authorization servers must not expose open redirectors that forward a browser to an arbitrary URI from a parameter.\nFor authorization-code flows, the RFC requires public clients to use PKCE and recommends it for confidential clients. Authorization servers must support PKCE, enforce the submitted code verifier when a challenge was present, and prevent downgrade behavior. The RFC identifies S256 as the current challenge method that does not expose the verifier in the authorization request. A PKCE challenge or permitted OpenID Connect nonce must be transaction-specific and securely bound to the client and user agent that started the transaction.\nWhat the source does not establish\nExact redirect matching and PKCE do not prove the client, browser, authorization server, resource server, or registered application is trustworthy. They do not correct excessive scopes, missing audience checks, insecure refresh-token handling, compromised endpoints, malicious app registration, or authorization decisions made after token issuance.\nThe RFC defines protocol practice, not a product certification. Provider behavior, native-app redirect mechanisms, reverse proxies, software libraries, and migration constraints must be checked for the exact implementation. Changing redirect registration or PKCE enforcement can interrupt production clients if their real behavior is not known.\nApplicability questions\n\nWhich clients use authorization code, implicit, device, client-credentials, or another flow?\nWhat exact redirect URI does each deployed version send, and where is it registered?\nAre wildcard, pattern, alternate-scheme, proxy-rewritten, or environment-shared redirects accepted anywhere?\nDoes every public client create a fresh high-entropy verifier and use S256 for each transaction?\nDoes the authorization server reject a missing, altered, reused, or incorrectly bound verifier?\nWhich legacy libraries or brokers would fail if the current BCP were enforced?\n\nDSE recommendation: test the complete redirect and code binding\nThe following steps are DSE recommendations based on the cited source.\nBuild a register of authorization servers, client identifiers, owners, client types, flows, registered redirect URIs, real redirect URIs, PKCE methods, libraries, and production dependencies. Confirm those values from configuration and observed transactions rather than an architecture diagram alone.\nFor each authorization-code client, test the approved exact redirect and then deliberately change the scheme, host, port where no exception applies, path, case, encoding, query, and suffix. The authorization server should reject every unregistered value. Test client and server endpoints for open-redirect behavior. Exercise PKCE with the correct verifier, an incorrect verifier, a missing verifier, a reused verifier, a downgraded challenge method, and a token request that supplies a verifier when no challenge began the transaction.\nMove incompatible clients through an owned migration rather than leaving a broad exception. Record the business dependency, affected versions, compensating restrictions, deadline, and retirement evidence. Coordinate changes across application, identity, API, and monitoring owners, with rollback that does not silently restore unsafe matching.\nVerification and evidence\nRetain the client register, authorization-server configuration, registered redirect export, library and version inventory, redacted protocol traces, negative-test results, change approvals, exceptions, and production monitoring. Evidence should show both the accepted transaction and the rejected mutations without preserving usable authorization codes, tokens, client secrets, or PKCE verifiers.\nOfficial references\n\nRFC 9700 — Best Current Practice for OAuth 2.0 Security — Internet Engineering Task Force; published January 2025",
        "content_markdown": "Bottom line: an OAuth login that succeeds does not prove the authorization-code flow is safely bound to the intended client. Exact redirect URI comparison and correctly enforced Proof Key for Code Exchange (PKCE) close different substitution and code-injection paths, and both need negative testing.\n\n## Source fact: what the OAuth security BCP requires\n\n[RFC 9700](https://www.rfc-editor.org/rfc/rfc9700.html), published as an Internet Best Current Practice in January 2025, updates OAuth 2.0 security guidance using experience with deployed systems. For redirect-based flows, it says authorization servers must compare a requested redirect URI with the pre-registered value using exact string matching, except for the permitted handling of localhost port numbers for native applications. It also says clients and authorization servers must not expose open redirectors that forward a browser to an arbitrary URI from a parameter.\n\nFor authorization-code flows, the RFC requires public clients to use PKCE and recommends it for confidential clients. Authorization servers must support PKCE, enforce the submitted code verifier when a challenge was present, and prevent downgrade behavior. The RFC identifies S256 as the current challenge method that does not expose the verifier in the authorization request. A PKCE challenge or permitted OpenID Connect nonce must be transaction-specific and securely bound to the client and user agent that started the transaction.\n\n## What the source does not establish\n\nExact redirect matching and PKCE do not prove the client, browser, authorization server, resource server, or registered application is trustworthy. They do not correct excessive scopes, missing audience checks, insecure refresh-token handling, compromised endpoints, malicious app registration, or authorization decisions made after token issuance.\n\nThe RFC defines protocol practice, not a product certification. Provider behavior, native-app redirect mechanisms, reverse proxies, software libraries, and migration constraints must be checked for the exact implementation. Changing redirect registration or PKCE enforcement can interrupt production clients if their real behavior is not known.\n\n## Applicability questions\n\n- Which clients use authorization code, implicit, device, client-credentials, or another flow?\n\n- What exact redirect URI does each deployed version send, and where is it registered?\n\n- Are wildcard, pattern, alternate-scheme, proxy-rewritten, or environment-shared redirects accepted anywhere?\n\n- Does every public client create a fresh high-entropy verifier and use S256 for each transaction?\n\n- Does the authorization server reject a missing, altered, reused, or incorrectly bound verifier?\n\n- Which legacy libraries or brokers would fail if the current BCP were enforced?\n\n## DSE recommendation: test the complete redirect and code binding\n\nThe following steps are DSE recommendations based on the cited source.\n\nBuild a register of authorization servers, client identifiers, owners, client types, flows, registered redirect URIs, real redirect URIs, PKCE methods, libraries, and production dependencies. Confirm those values from configuration and observed transactions rather than an architecture diagram alone.\n\nFor each authorization-code client, test the approved exact redirect and then deliberately change the scheme, host, port where no exception applies, path, case, encoding, query, and suffix. The authorization server should reject every unregistered value. Test client and server endpoints for open-redirect behavior. Exercise PKCE with the correct verifier, an incorrect verifier, a missing verifier, a reused verifier, a downgraded challenge method, and a token request that supplies a verifier when no challenge began the transaction.\n\nMove incompatible clients through an owned migration rather than leaving a broad exception. Record the business dependency, affected versions, compensating restrictions, deadline, and retirement evidence. Coordinate changes across application, identity, API, and monitoring owners, with rollback that does not silently restore unsafe matching.\n\n## Verification and evidence\n\nRetain the client register, authorization-server configuration, registered redirect export, library and version inventory, redacted protocol traces, negative-test results, change approvals, exceptions, and production monitoring. Evidence should show both the accepted transaction and the rejected mutations without preserving usable authorization codes, tokens, client secrets, or PKCE verifiers.\n\n## Official references\n\n- [RFC 9700 — Best Current Practice for OAuth 2.0 Security](https://www.rfc-editor.org/rfc/rfc9700.html) — Internet Engineering Task Force; published January 2025"
    },
    "json_ld": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://dsesecurity.com/#organization",
                "name": "Detection Systems & Engineering",
                "alternateName": "DSE Security",
                "url": "https://dsesecurity.com/",
                "logo": {
                    "@type": "ImageObject",
                    "url": "https://update.dsesecurity.com/assets/dse-logo-20260812.png?v=1.8.20"
                }
            },
            {
                "@type": "Organization",
                "@id": "https://update.dsesecurity.com/#editorial-team",
                "name": "DSE Security Editorial Team",
                "url": "https://update.dsesecurity.com/",
                "parentOrganization": {
                    "@id": "https://dsesecurity.com/#organization"
                }
            },
            {
                "@type": "WebSite",
                "@id": "https://update.dsesecurity.com/#website",
                "name": "DSE Updates",
                "alternateName": "DSE Security Knowledge Hub",
                "url": "https://update.dsesecurity.com/",
                "inLanguage": "en-US",
                "publisher": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "potentialAction": {
                    "@type": "SearchAction",
                    "target": {
                        "@type": "EntryPoint",
                        "urlTemplate": "https://update.dsesecurity.com/?q={search_term_string}"
                    },
                    "query-input": "required name=search_term_string"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/",
                "url": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/",
                "isPartOf": {
                    "@id": "https://update.dsesecurity.com/#website"
                },
                "lastReviewed": "2026-08-25"
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/#breadcrumbs",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "DSE Updates",
                        "item": "https://update.dsesecurity.com/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Require exact redirect matching and PKCE in OAuth authorization-code flows",
                        "item": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/"
                    }
                ]
            },
            {
                "@type": [
                    "Article",
                    "TechArticle"
                ],
                "@id": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/#article",
                "identifier": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/",
                "url": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/",
                "headline": "Require exact redirect matching and PKCE in OAuth authorization-code flows",
                "description": "OAuth authorization-code flows need exact redirect URI matching and correctly enforced PKCE. Treat both as testable protocol controls across every…",
                "abstract": "OAuth authorization-code flows need exact redirect URI matching and correctly enforced PKCE. Treat both as testable protocol controls across every client and authorization server.",
                "articleBody": "Bottom line: an OAuth login that succeeds does not prove the authorization-code flow is safely bound to the intended client. Exact redirect URI comparison and correctly enforced Proof Key for Code Exchange (PKCE) close different substitution and code-injection paths, and both need negative testing.\nSource fact: what the OAuth security BCP requires\nRFC 9700, published as an Internet Best Current Practice in January 2025, updates OAuth 2.0 security guidance using experience with deployed systems. For redirect-based flows, it says authorization servers must compare a requested redirect URI with the pre-registered value using exact string matching, except for the permitted handling of localhost port numbers for native applications. It also says clients and authorization servers must not expose open redirectors that forward a browser to an arbitrary URI from a parameter.\nFor authorization-code flows, the RFC requires public clients to use PKCE and recommends it for confidential clients. Authorization servers must support PKCE, enforce the submitted code verifier when a challenge was present, and prevent downgrade behavior. The RFC identifies S256 as the current challenge method that does not expose the verifier in the authorization request. A PKCE challenge or permitted OpenID Connect nonce must be transaction-specific and securely bound to the client and user agent that started the transaction.\nWhat the source does not establish\nExact redirect matching and PKCE do not prove the client, browser, authorization server, resource server, or registered application is trustworthy. They do not correct excessive scopes, missing audience checks, insecure refresh-token handling, compromised endpoints, malicious app registration, or authorization decisions made after token issuance.\nThe RFC defines protocol practice, not a product certification. Provider behavior, native-app redirect mechanisms, reverse proxies, software libraries, and migration constraints must be checked for the exact implementation. Changing redirect registration or PKCE enforcement can interrupt production clients if their real behavior is not known.\nApplicability questions\n\nWhich clients use authorization code, implicit, device, client-credentials, or another flow?\nWhat exact redirect URI does each deployed version send, and where is it registered?\nAre wildcard, pattern, alternate-scheme, proxy-rewritten, or environment-shared redirects accepted anywhere?\nDoes every public client create a fresh high-entropy verifier and use S256 for each transaction?\nDoes the authorization server reject a missing, altered, reused, or incorrectly bound verifier?\nWhich legacy libraries or brokers would fail if the current BCP were enforced?\n\nDSE recommendation: test the complete redirect and code binding\nThe following steps are DSE recommendations based on the cited source.\nBuild a register of authorization servers, client identifiers, owners, client types, flows, registered redirect URIs, real redirect URIs, PKCE methods, libraries, and production dependencies. Confirm those values from configuration and observed transactions rather than an architecture diagram alone.\nFor each authorization-code client, test the approved exact redirect and then deliberately change the scheme, host, port where no exception applies, path, case, encoding, query, and suffix. The authorization server should reject every unregistered value. Test client and server endpoints for open-redirect behavior. Exercise PKCE with the correct verifier, an incorrect verifier, a missing verifier, a reused verifier, a downgraded challenge method, and a token request that supplies a verifier when no challenge began the transaction.\nMove incompatible clients through an owned migration rather than leaving a broad exception. Record the business dependency, affected versions, compensating restrictions, deadline, and retirement evidence. Coordinate changes across application, identity, API, and monitoring owners, with rollback that does not silently restore unsafe matching.\nVerification and evidence\nRetain the client register, authorization-server configuration, registered redirect export, library and version inventory, redacted protocol traces, negative-test results, change approvals, exceptions, and production monitoring. Evidence should show both the accepted transaction and the rejected mutations without preserving usable authorization codes, tokens, client secrets, or PKCE verifiers.\nOfficial references\n\nRFC 9700 — Best Current Practice for OAuth 2.0 Security — Internet Engineering Task Force; published January 2025",
                "datePublished": "2026-08-25T21:34:05+00:00",
                "dateModified": "2026-08-26T13:27:47+00:00",
                "mainEntityOfPage": {
                    "@id": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/"
                },
                "inLanguage": "en-US",
                "isAccessibleForFree": true,
                "author": {
                    "@type": "Organization",
                    "name": "DSE Security Editorial Team",
                    "url": "https://update.dsesecurity.com/#editorial-team"
                },
                "publisher": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "image": {
                    "@type": "ImageObject",
                    "@id": "https://update.dsesecurity.com/updates/oauth-exact-redirect-matching-and-pkce/#primaryimage",
                    "url": "https://update.dsesecurity.com/assets/editorial/identity-cloud-social-v2.jpg?v=1.8.20",
                    "contentUrl": "https://update.dsesecurity.com/assets/editorial/identity-cloud-social-v2.jpg?v=1.8.20",
                    "width": 1200,
                    "height": 630,
                    "caption": "Require exact redirect matching and PKCE in OAuth authorization-code flows"
                },
                "articleSection": [
                    "Cybersecurity",
                    "IT",
                    "Microsoft 365 & Identity"
                ],
                "keywords": [
                    "Cybersecurity",
                    "IT",
                    "Microsoft 365 & Identity",
                    "Guide",
                    "Important priority"
                ],
                "genre": "Guide",
                "about": [
                    {
                        "@type": "Thing",
                        "name": "Cybersecurity",
                        "url": "https://update.dsesecurity.com/topic/cybersecurity/"
                    },
                    {
                        "@type": "Thing",
                        "name": "IT",
                        "url": "https://update.dsesecurity.com/topic/it/"
                    },
                    {
                        "@type": "Thing",
                        "name": "Microsoft 365 & Identity",
                        "url": "https://update.dsesecurity.com/topic/microsoft-365-identity/"
                    }
                ],
                "wordCount": 620,
                "timeRequired": "PT3M",
                "publishingPrinciples": "https://update.dsesecurity.com/updates/dse-updates-editorial-methodology/",
                "usageInfo": "https://update.dsesecurity.com/usage/",
                "copyrightHolder": {
                    "@id": "https://dsesecurity.com/#organization"
                },
                "copyrightNotice": "Copyright © 2026 Detection Systems & Engineering. All rights reserved.",
                "citation": {
                    "@type": "CreativeWork",
                    "name": "RFC 9700 — Best Current Practice for OAuth 2.0 Security",
                    "url": "https://www.rfc-editor.org/rfc/rfc9700.html"
                }
            }
        ]
    }
}