diff --git a/README.md b/README.md index c2e80c7..c67f645 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,8 @@ # Backlog - Form validation -- UI -- Add timestamp to tables -- Feed 10 users - -1. Autogenerate certificate -2. Request validation -3. Add logs to all request - -SAML certificate (PEM format) - -you need to generate a set of public and private keys and an X.509 certificate that contains the public key. The public keys and certificates must be generated with either the RSA or DSA algorithm and registered with Google. - -/apps/ - -ACS URL -Entity ID - -Certificate -> Use same Certificate for all apps - -Metadata Properties - -- entityID (IdP identity) -- validUntil (Hard coded) -- X509Certificate (Hard coded) -- SingleSignOnService -> Binding - -/apps/metadata -> Download +- Feed some users +- Fix the download metadata +- Add the SAML response +- Fix the SAML metadata URL +- Improve the UI diff --git a/pages/api/apps/metadata.ts b/pages/api/apps/metadata.ts index a2c969a..7bdf6ba 100644 --- a/pages/api/apps/metadata.ts +++ b/pages/api/apps/metadata.ts @@ -19,9 +19,9 @@ export default async function handler( const xml = await metadata.createXML(acs_url, entity_id, certificate); - return res.send(xml); + res.setHeader('Content-type', 'text/xml'); + res.setHeader('Content-Disposition', 'attachment; filename="metadata.xml"'); - // res.setHeader('Content-type', 'text/xml'); - // res.setHeader('Content-Disposition', 'attachment; filename="text.xml"'); + return res.send(xml); } } diff --git a/pages/apps/index.tsx b/pages/apps/index.tsx index b66deda..f566259 100644 --- a/pages/apps/index.tsx +++ b/pages/apps/index.tsx @@ -31,6 +31,14 @@ const Apps: NextPage = () => { setMetadata(data); }; + const downloadMetadata = async (e: ChangeEvent) => { + e.preventDefault(); + + const {data} = await axios.post('/api/apps/metadata', { + ...formData + }); + } + return (
@@ -51,6 +59,8 @@ const Apps: NextPage = () => {
+ +
  • SSO URL:

    {metadata.sso_url}
  • Entity ID:

    {metadata.entity_id}
  • diff --git a/services/metadata.ts b/services/metadata.ts index b2286e8..b001a6d 100644 --- a/services/metadata.ts +++ b/services/metadata.ts @@ -46,10 +46,10 @@ export const createXML = async ( '@use': 'signing', 'ds:KeyInfo': { '@xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#', - }, - 'ds:X509Data': { - 'ds:X509Certificate': { - '#text': `${formatCert(certificate)}`, + 'ds:X509Data': { + 'ds:X509Certificate': { + '#text': `${formatCert(certificate)}`, + }, }, }, },