Skip to content

Fix/introspection basic auth base64 - #66

Merged
kdekraker merged 5 commits into
mainfrom
fix/introspection-basic-auth-base64
Oct 15, 2026
Merged

kdekraker merged 5 commits into
mainfrom
fix/introspection-basic-auth-base64

Conversation

@kdekraker

Copy link
Copy Markdown
Contributor

No description provided.

kdekraker and others added 3 commits October 15, 2026 18:33
TNetEncoding.Base64 inserts CRLF after every 76 characters, so a client_id:client_secret of 57 bytes or more produced a broken Authorization header on the introspection request and every token was rejected. TNetEncoding.Base64String encodes without line breaks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
Both introspection tests start the local Indy server through StartIntrospection, the client id and active token are constants, and the new test keeps its values in locals.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu

@kdekraker kdekraker left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude Verwerk de comments

Comment thread tests/MCPServer.Tests.Authorization.pas Outdated
end;

procedure TAuthorizationTests.Introspection_PostsTokenWithClientCredentials;
function TAuthorizationTests.StartIntrospection: string;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude Deze functienaam veronderstelt dat je iets start. In feite voert het de binding uit, maar het retourneert ook de URL. Dat is niet duidelijk uit deze functienaam.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opgelost in 6273fb2: gesplitst in StartIntrospectionServer (start de server) en IntrospectionUrl (geeft het adres terug).

Comment thread tests/MCPServer.Tests.Authorization.pas Outdated
begin
const Url = StartIntrospection;

const Authorizer: IMCPAuthorizer = TMCPIntrospectionAuthorizer.Create(AUDIENCE, Url, IntrospectionClientId, 's3cret');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude Als je in de code AUDIENCE gebruikt, dan mag deze conform de GDK skills ook aangepast worden naar de correcte PascalCase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opgelost in 6273fb2: AUDIENCE heet nu Audience, alle gebruikplekken in de unit zijn aangepast.

…onstant

StartIntrospectionServer starts the local server and IntrospectionUrl returns its address, so each name says what it does. AUDIENCE becomes Audience.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
@claude

claude Bot commented Oct 15, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread tests/MCPServer.Tests.Authorization.pas Outdated
var Authorizer: IMCPAuthorizer := TClaimsAuthorizer.Create(AUDIENCE,
Format('{"sub":"u","aud":["https://other","%s"],"exp":%d,"scp":["a","b"]}', [AUDIENCE.ToUpper, Future]));
var Authorizer: IMCPAuthorizer := TClaimsAuthorizer.Create(Audience,
Format('{"sub":"u","aud":["https://other","%s"],"exp":%d,"scp":["a","b"]}', [Audience.ToUpper, Future]));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deze uitlijning is niet conform de GDK regels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opgelost in 418f4d9: de claims-JSON staat nu in een eigen const, waardoor de meerregelige aanroep verdwijnt. Dezelfde regels zijn toegepast op alle andere regels die deze PR raakt.

Claims JSON, credentials and expiry are built in their own locals instead of nested calls as arguments, immutable locals are const, and the repeated claims format is a constant. This also removes the misaligned continuation line.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WbQohkUArrh3cWmZirXpzu
@kdekraker
kdekraker merged commit a4638dd into main Oct 15, 2026
3 checks passed
@kdekraker
kdekraker deleted the fix/introspection-basic-auth-base64 branch October 15, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant