Skip to content

Commit d9aa0f3

Browse files
peppescgclaude
andcommitted
Clarify when the DCR registration probe decides
Only servers that authenticate the client before validating the grant answer invalid_client for a deleted registration. For public clients some servers validate the code first, and the probe then keeps the cached registration as before. Signed-off-by: Giuseppe Scuglia <peppescg@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 50d7b9e commit d9aa0f3

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

‎pkg/auth/dcr/validate.go‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ var errProbeRedirectRefused = errors.New("dcr: token endpoint returned a redirec
4848
// that sees the resulting authorize error, so the resolver must ask.
4949
//
5050
// The probe redeems a random authorization code with the cached client
51-
// credentials. Token endpoints authenticate the client before validating the
52-
// grant (RFC 6749 §5.2), so invalid_client means the registration is gone and
53-
// invalid_grant means it is alive. No token can be issued for the random code.
54-
// Every other outcome, including transport failures, is unverified: callers
55-
// keep the cached registration so an unreachable upstream never blocks
56-
// startup.
51+
// credentials. Servers that authenticate the client before validating the
52+
// grant (as fosite does, for public and confidential clients alike) answer
53+
// invalid_client when the registration is gone and invalid_grant when it is
54+
// alive. No token can be issued for the random code. RFC 6749 §4.1.3 only
55+
// requires confidential clients to authenticate, so for a public client some
56+
// servers validate the code first and answer invalid_grant for any client_id;
57+
// against those servers the probe cannot detect a deleted registration and
58+
// the cached one is kept, as before. Every other outcome, including transport
59+
// failures, is unverified: callers keep the cached registration so an
60+
// unreachable upstream never blocks startup.
5761
//
5862
// The configured token endpoint wins over the cached one, mirroring
5963
// applyExplicitEndpointOverrides, so a tampered cached endpoint cannot

0 commit comments

Comments
 (0)