wip
This commit is contained in:
parent
65037b3116
commit
eea4b1527e
32
README.md
32
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/<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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -46,13 +46,13 @@ export const createXML = async (
|
||||
'@use': 'signing',
|
||||
'ds:KeyInfo': {
|
||||
'@xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#',
|
||||
},
|
||||
'ds:X509Data': {
|
||||
'ds:X509Certificate': {
|
||||
'#text': `${formatCert(certificate)}`,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'md:NameIDFormat': {
|
||||
'#text': 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user