Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/lib/examples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,6 @@ describe('EXAMPLES', () => {
expect(decodeSaml(url!.payload()).summary.binding).toBe('redirect');
});

it('POST binding example uses post binding', () => {
const post = EXAMPLES.find(
(e) => e.category === 'Query string' && e.label.includes('POST')
);
expect(post).toBeDefined();
expect(decodeSaml(post!.payload()).summary.binding).toBe('post');
});

it('MFA SAMLResponse has REFEDS MFA authn context', () => {
const mfa = EXAMPLES.find(
(e) => e.category === 'SAMLResponse' && e.label.includes('MFA')
Expand Down
14 changes: 0 additions & 14 deletions src/lib/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ function encodeRedirectBinding(xml: string): string {
return encodeURIComponent(btoa(binary));
}

function encodePostBinding(xml: string): string {
const bytes = new TextEncoder().encode(xml);
let binary = '';
for (let i = 0; i < bytes.length; i++) {
binary += String.fromCharCode(bytes[i]);
}
return btoa(binary);
}

function b64url(obj: object): string {
return btoa(JSON.stringify(obj))
.replace(/=/g, '')
Expand Down Expand Up @@ -229,11 +220,6 @@ export const EXAMPLES: Example[] = [
payload: () =>
`SAMLRequest=${encodeRedirectBinding(samlRequest())}&RelayState=%2Fdashboard`,
},
{
label: 'POST binding form value',
category: 'Query string',
payload: () => `SAMLResponse=${encodeURIComponent(encodePostBinding(samlResponse()))}`,
},
{
label: 'IdP redirect binding URL',
category: 'Full URL',
Expand Down