English
Русский
The web-component provides an easier way to connect a web-page to the Fortify App, show available OS crypto providers, and enroll self-signed certificate or certificate request with prefilled parameters.
Quick example embed web component in to you application:
<peculiar-fortify-enrollment
id="fortify-enrollment-wc"
language="en"
/>
Then in js you can access to component lifecycle events and filter properties:
const fortifyEnrollment = document.getElementById('fortify-enrollment-wc');
fortifyEnrollment.filters = {
onlySmartcards: false,
providerNameMatch: 'MacOS Crypto',
providerATRMatch: '0123456789',
};
fortifyEnrollment.addEventListener('creationCancel', () => {
console.log('creationCancel');
});
fortifyEnrollment.addEventListener('creationClose', () => {
console.log('creationClose');
});
fortifyEnrollment.addEventListener('creationSuccess', (result) => {
console.log(result);
});
fortifyEnrollment.addEventListener('creationFail', (error) => {
console.log(error);
});
To provide custom form policy you need to pass object to component.
Default policy config:
{
subject: {
fields: {
CN: {
required: true
},
O: {
required: false
},
OU: {
required: false
},
C: {
required: false,
defaultValue: "US"
},
L: {
required: false
},
ST: {
required: false
}
}
},
publicKey: {
fields: {
signatureAlgorithm: {
required: true,
defaultValue: "RSA-2048"
},
hashAlgorithm: {
required: true,
defaultValue: "SHA-256"
}
}
},
options: {
fields: {
useSelfSignedCertificate: {
required: false
}
}
}
}
Example of read only policy with prefilled values:
const fortifyEnrollment = document.getElementById('fortify-enrollment-wc');
fortifyEnrollment.formPolicy = {
subject: {
fields: {
CN: {
required: true,
readOnly: true,
defaultValue: 'kubernetes',
},
O: {
required: false,
readOnly: true,
defaultValue: 'kubernetes org.',
},
OU: {
required: false,
readOnly: true,
defaultValue: 'kubernetes org. unit',
},
C: {
required: false,
readOnly: true,
defaultValue: "US"
},
L: {
required: false,
readOnly: true,
defaultValue: "kubernetes world"
},
ST: {
required: false,
readOnly: true,
defaultValue: "kubernetes west"
}
}
},
publicKey: {
fields: {
signatureAlgorithm: {
required: true,
readOnly: true,
defaultValue: "RSA-2048"
},
hashAlgorithm: {
required: true,
readOnly: true,
defaultValue: "SHA-256"
}
}
},
options: {
fields: {
useSelfSignedCertificate: {
required: false,
readOnly: true,
defaultValue: true
}
}
}
};
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
downloadAppLink |
download-app-link |
A link to download the application when a connection to Fortify is not found. | string |
'https://fortifyapp.com#download_app' |
filters |
-- | Object that contains filters for user certificates and providers. | { onlySmartcards?: boolean; providerNameMatch?: string | RegExp; providerATRMatch?: string | RegExp; } |
{} |
formPolicy |
-- | Object that contains configurations for enrollment form. | IFormPolicyConfig |
undefined |
helpPageLink |
help-page-link |
A link to redirect the user to the help page if there are any questions about the operation of the application. | string |
'https://fortifyapp.com/#faq' |
hideFooter |
hide-footer |
If true , the component footer will be hidden. |
boolean |
false |
language |
language |
Component language. | "de" | "el" | "en" | "es" | "fr" | "he" | "it" | "ja" | "nl" | "pl" | "pt" | "ru" | "tr" |
undefined |
Event | Description | Type |
---|---|---|
creationCancel |
Fires when the user has canceled the creation flow. | CustomEvent<void> |
creationClose |
Fires when the user clicks on the "Close" button after successfully creating a certificate or certificate request. | CustomEvent<void> |
creationFail |
Fires when the user failed to generate a certificate or certificate request. | CustomEvent<Error> |
creationSuccess |
Fires when the user has successfully created a certificate or certificate request. | CustomEvent<ICreationSuccessEvent> |