@kilterset/auth0-actions-testing
Version:
Test and develop Auth0 Actions or Okta CIC Actions locally.
49 lines • 1.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.samlResponseMock = samlResponseMock;
function samlResponseMock(flow) {
const state = {
// Custom attributes
attributes: {},
// Default literal values
createUpnClaim: true,
passthroughClaimsWithNoMapping: true,
mapUnknownClaimsAsIs: false,
mapIdentities: true,
signResponse: false,
includeAttributeNameFormat: true,
typedAttributes: true,
lifetimeInSeconds: 3600,
nameIdentifierFormat: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
nameIdentifierProbes: [
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
],
authnContextClassRef: "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified",
// Default dynamic values
audience: "default-audience",
recipient: "default-recipient",
destination: "default-destination",
};
const samlResponse = {
setAttribute: (attribute, value) => {
state.attributes[attribute] = value;
},
};
for (const property in state) {
if (state.hasOwnProperty(property)) {
const key = property;
if (key === "attributes") {
continue;
}
const setter = `set${key[0].toUpperCase()}${key.slice(1)}`;
samlResponse[setter] = (value) => {
state[key] = value;
};
}
}
const build = (api) => samlResponse;
return { state, build };
}
//# sourceMappingURL=saml-response.js.map