mocksaml/services/metadata.ts

21 lines
409 B
TypeScript
Raw Normal View History

2022-01-13 17:07:44 +00:00
import type { IdPMetadata } from '../types';
2022-01-13 17:50:16 +00:00
const baseUrl = 'http://localhost:3000/saml';
2022-01-13 17:07:44 +00:00
export const create = (
2022-01-13 17:50:16 +00:00
acs_url: string,
entity_id: string,
2022-01-13 17:07:44 +00:00
certificate: string
): IdPMetadata => {
2022-01-13 17:50:16 +00:00
const params = new URLSearchParams({
acs_url,
entity_id,
}).toString();
2022-01-13 17:07:44 +00:00
return {
2022-01-13 17:50:16 +00:00
sso_url: `${baseUrl}?${params}`,
entity_id: `${baseUrl}?${params}`,
certificate: certificate,
2022-01-13 17:07:44 +00:00
};
};