Tweaks (#1)
* cleanup and pin versions * tweaked metadata markers, formatted metadata, cleaned up .env.example file
This commit is contained in:
parent
9f6f714f41
commit
4ec1bc044e
@ -1,4 +1,2 @@
|
||||
NODE_ENV=dev
|
||||
DATABASE_URL=
|
||||
APP_URL=http://localhost:4000
|
||||
ENTITY_ID=http://saml.example.com
|
||||
ENTITY_ID=https://saml.example.com/entityid
|
||||
|
||||
@ -1,15 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="idp_entity_id" validUntil="2026-06-22T18:39:53.000Z">
|
||||
<md:IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
||||
<md:KeyDescriptor use="signing">
|
||||
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<ds:X509Data>
|
||||
<ds:X509Certificate>idp_certificate</ds:X509Certificate>
|
||||
</ds:X509Data>
|
||||
</ds:KeyInfo>
|
||||
</md:KeyDescriptor>
|
||||
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>
|
||||
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="idp_sso_url"/>
|
||||
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="idp_sso_url"/>
|
||||
</md:IDPSSODescriptor>
|
||||
</md:EntityDescriptor>
|
||||
<EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="{{idp_entity_id}}" validUntil="2026-06-22T18:39:53.000Z">
|
||||
<IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
|
||||
<KeyDescriptor use="signing">
|
||||
<KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
|
||||
<X509Data>
|
||||
<X509Certificate>
|
||||
{{idp_certificate}}
|
||||
</X509Certificate>
|
||||
</X509Data>
|
||||
</KeyInfo>
|
||||
</KeyDescriptor>
|
||||
<NameIDFormat>
|
||||
urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
|
||||
</NameIDFormat>
|
||||
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="{{idp_sso_url}}" />
|
||||
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="{{idp_sso_url}}" />
|
||||
</IDPSSODescriptor>
|
||||
</EntityDescriptor>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
const appUrl = process.env.APP_URL || 'http://localhost:4000';
|
||||
const entityId = process.env.ENTITY_ID || 'http://saml.example.com';
|
||||
const entityId = process.env.ENTITY_ID || 'https://saml.example.com/entityid';
|
||||
const ssoUrl = `${appUrl}/api/saml/sso`;
|
||||
|
||||
const config = {
|
||||
|
||||
7687
package-lock.json
generated
7687
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@ -4,7 +4,7 @@
|
||||
"scripts": {
|
||||
"dev": "next dev -p 4000",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"start": "next start -p 4000",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -12,16 +12,15 @@
|
||||
"node-forge": "^1.2.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"webpack-filter-warnings-plugin": "^1.2.1",
|
||||
"xml-crypto": "^2.1.3",
|
||||
"xml2js": "^0.4.23",
|
||||
"xmlbuilder": "^15.1.1"
|
||||
"xml-crypto": "2.1.3",
|
||||
"xml2js": "0.4.23",
|
||||
"xmlbuilder": "15.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "17.0.8",
|
||||
"@types/node-forge": "^1.0.0",
|
||||
"@types/node-forge": "1.0.0",
|
||||
"@types/react": "17.0.38",
|
||||
"@types/xml-crypto": "^1.4.2",
|
||||
"@types/xml-crypto": "1.4.2",
|
||||
"@types/xml2js": "0.4.9",
|
||||
"autoprefixer": "10.4.2",
|
||||
"eslint": "8.6.0",
|
||||
|
||||
@ -16,9 +16,9 @@ const createIdPMetadataXML = async ({
|
||||
certificate = stripCertHeaderAndFooter(certificate);
|
||||
|
||||
return xml
|
||||
.replace('idp_entity_id', idpEntityId)
|
||||
.replace('idp_certificate', certificate)
|
||||
.replace(/idp_sso_url/g, idpSsoUrl);
|
||||
.replace('{{idp_entity_id}}', idpEntityId)
|
||||
.replace('{{idp_certificate}}', certificate)
|
||||
.replace(/{{idp_sso_url}}/g, idpSsoUrl);
|
||||
};
|
||||
|
||||
export { createIdPMetadataXML };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user