This commit is contained in:
Kiran 2022-01-14 01:12:17 +05:30
parent 65037b3116
commit eea4b1527e
4 changed files with 22 additions and 34 deletions

View File

@ -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/<id>
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

View File

@ -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);
}
}

View File

@ -31,6 +31,14 @@ const Apps: NextPage = () => {
setMetadata(data);
};
const downloadMetadata = async (e: ChangeEvent<HTMLInputElement>) => {
e.preventDefault();
const {data} = await axios.post('/api/apps/metadata', {
...formData
});
}
return (
<div>
<form onSubmit={createApp} className="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
@ -51,6 +59,8 @@ const Apps: NextPage = () => {
<button type="submit" className="bg-blue-500 text-white py-2 px-4 rounded">Build IdP Metadata</button>
</form>
<button type="button" className="bg-red-500 text-white py-2 px-3 rounded" onClick={downloadMetadata}>Download Metadata</button>
<ul className="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<li className="px-2 py-2"><strong>SSO URL:</strong> <br></br> {metadata.sso_url}</li>
<li className="px-2 py-2"><strong>Entity ID:</strong> <br></br> {metadata.entity_id}</li>

View File

@ -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)}`,
},
},
},
},