website/integrations/security/knocknoc/index.md
Knocknoc links your single-sign on experience to existing network access controls. It can dynamically orchestrate network access controls (e.g., managing firewall rules in real-time without exposing target machines) or function as an identity-aware gateway.
The following placeholders are used in this guide:
knocknoc.company is the FQDN of the Knocknoc installation.authentik.company is the FQDN of the authentik installation.:::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. :::
To support the integration of Knocknoc with authentik, you need to create an application/provider pair and three property mappings in authentik.
Select type: Select SAML Provider Property Mapping as the type and click Next.
Create SAML Provider Property Mapping:
SAML to Knocknoc realName)realNamereturn user.name
Select type: Select SAML Provider Property Mapping as the type and click Next.
Create SAML Provider Property Mapping:
SAML to Knocknoc groups)groupsfor group in user.groups.all(): yield group.name
Select type: Select SAML Provider Property Mapping as the type and click Next.
Create SAML Provider Property Mapping:
SAML to Knocknoc session duration)sessionDurationreturn 540
:::info This example sets the session duration to 540 minutes. Change the value to match your desired session duration in minutes. :::
https://knocknoc.company/api/saml/acshttps://authentik.companyPosthttps://knocknoc.company/api/saml/metadataAuthentik default SAML Mapping: Username.Provider for Knocknoc).SAML Metadata URL and will be needed in the next section.Log in to Knocknoc and navigate to Admin > Settings > SAML
Set the following configuration:
https://knocknoc.companyClick on Save.
:::info
Key file and Cert file are currently required fields in Knocknoc. You can generate a certificate and key on a Linux host with this command:
openssl req -new -x509 -days 3650 -nodes -subj /CN=Knocknoc/ -out <certificate_filename>.crt -keyout <certificate_key_filename>.key
:::
To confirm that authentik is properly configured with Knocknoc, log out and log back in using authentik credentials.