Skip to main content

Integrate with Apache Guacamole™

Support level: authentik

What is Apache Guacamole™

Apache Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH.

-- https://guacamole.apache.org/

Preparation

The following placeholders are used in this guide:

  • guacamole.company is the FQDN of the Guacamole installation.
  • authentik.company is the FQDN of the authentik installation.
note

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.

authentik configuration

To support the integration of Apache Guacamole with authentik, you need to create an application/provider pair in authentik.

Create an application and provider in authentik

  1. Log in to authentik as an admin, and open the authentik Admin interface.
  2. Navigate to Applications > Applications and click Create with Provider to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)
  • Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings.
  • Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
  • Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
    • Note the Client ID,Client Secret, and slug values because they will be required later.
    • Set a Strict redirect URI to https://guacamole.company/. If you have configured Apache Tomcat to run Apache Guacamole on a subpath, you will need to update this value accordingly.
    • Select any available signing key.
    • Note that Apache Guacamole does not support session tokens longer than 300 minutes (5 hours).
  • Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's My applications page.
  1. Click Submit to save the new application and provider.

Apache Guacamole Configuration

It is recommended to create an admin account in Guacamole before configuring Single Sign-On to simplify the process. Create a user in Guacamole using the same username as in authentik and grant them admin permissions. This step is important to avoid losing access to the Guacamole admin settings, as you may need to revert your changes without it.

warning

You can configure Apache Guacamole to use either the sub or preferred_username as the UID field under user-name-attribute. When using preferred_username as the user identifier, ensure that the Allow users to change username setting is disabled to prevent authentication issues. The sub option uses a unique, stable identifier for the user, while preferred_username uses the username configured in authentik.

Docker containers are typically configured using environment variables. To ensure proper integration, add the following variables to your .env file:

OPENID_AUTHORIZATION_ENDPOINT=https://authentik.company/application/o/authorize/
OPENID_CLIENT_ID=<Client ID from authentik>
OPENID_ISSUER=https://authentik.company/application/o/<your-slug>/
OPENID_JWKS_ENDPOINT=https://authentik.company/application/o/<your-slug>/jwks/
OPENID_REDIRECT_URI=https://guacamole.company/
OPENID_USERNAME_CLAIM_TYPE=preferred_username

Additionally, ensure your guacamole.properties file (typically located in /etc/guacamole/) includes the following line. This setting allows environment variables to be evaluated before static configuration files:

enable-environment-properties: true

Self Signed Certificates

When using a self-signed certificate, it is necessary to incorporate the certificate of the corresponding Certificate Authority into both the /etc/ssl/certs/ca-certificates.crt file and the /opt/java/openjkd/jre/lib/security/cacerts keystore on your Apache Guacamole host. This ensures that the self-signed certificate is trusted by both the system and the Java runtime environment used by Guacamole.

Adding Certificate Authority certificate as trusted in /etc/ssl/certs/ca-certificates.crt

note

This section depends on the operating system hosting Apache Guacamole.

For Debian based operating systems:
  1. Copy the certificate of the Certificate Authority (e.g. <CA_certificate>.crt) to the /usr/local/share/ca-certificates/ directory on the Apache Guacamole host. Ensure that the file extension is .crt.

  2. To add the certificate as trusted in /etc/ssl/certs/ca-certificates.crt, use the following command:

    update-ca-certificates
For Synology systems:
  1. Copy the certificate of the Certificate Authority (e.g. <CA_certificate>.crt) to the /usr/syno/etc/security-profile/ca-bundle-profile/ca-certificates/ directory on the Synology host. Ensure that the filetype is .crt.

  2. To add the certificate as trusted in /etc/ssl/certs/ca-certificates.crt, use the following command:

    update-ca-certificates.sh

Adding Certificate Authority certificate to /opt/java/openjkd/jre/lib/security/cacerts

  1. To export the certificate of the Certificate Authority, use the following command on the Certificate Authority host:

    openssl pkcs12 -export -in <CA_certificate>.crt -inkey <CA_certificate>.key -out <CA_certificate>.p12 -passout pass:<password>
  2. To import the certificate to the /opt/java/openjdk/jre/lib/security/cacerts keystore on the Apache Guacamole host, use the following command:

    keytool -importkeystore -srckeystore <CA_certificate>.p12 -srcstoretype PKCS12 -keystore /opt/java/openjdk/jre/lib/security/cacerts -deststorepass <destination_store_password> -nopromt -srcstorepass <password>
note

More information on the keytool command can be found in the Oracle documentation.

Self Signed Certificates

When using a self-signed certificate, it is necessary to incorporate the certificate of the corresponding Certificate Authority into both the /etc/ssl/certs/ca-certificates.crt file and the /opt/java/openjkd/jre/lib/security/cacerts keystore on your Apache Guacamole host. This ensures that the self-signed certificate is trusted by both the system and the Java runtime environment used by Guacamole.

Adding Certificate Authority certificate as trusted in /etc/ssl/certs/ca-certificates.crt

note

This section depends on the operating system hosting Apache Guacamole.

For Debian based operating systems:
  1. Copy the certificate of the Certificate Authority (e.g. <CA_certificate>.crt) to the /usr/local/share/ca-certificates/ directory on the Apache Guacamole host. Ensure that the file extension is .crt.

  2. To add the certificate as trusted in /etc/ssl/certs/ca-certificates.crt, use the following command:

    update-ca-certificates
For Synology systems:
  1. Copy the certificate of the Certificate Authority (e.g. <CA_certificate>.crt) to the /usr/syno/etc/security-profile/ca-bundle-profile/ca-certificates/ directory on the Synology host. Ensure that the filetype is .crt.

  2. To add the certificate as trusted in /etc/ssl/certs/ca-certificates.crt, use the following command:

    update-ca-certificates.sh

Adding Certificate Authority certificate to /opt/java/openjkd/jre/lib/security/cacerts

  1. To export the certificate of the Certificate Authority, use the following command on the Certificate Authority host:

    openssl pkcs12 -export -in <CA_certificate>.crt -inkey <CA_certificate>.key -out <CA_certificate>.p12 -passout pass:<password>
  2. To import the certificate to the /opt/java/openjdk/jre/lib/security/cacerts keystore on the Apache Guacamole host, use the following command:

    keytool -importkeystore -srckeystore <CA_certificate>.p12 -srcstoretype PKCS12 -keystore /opt/java/openjdk/jre/lib/security/cacerts -deststorepass <destination_store_password> -nopromt -srcstorepass <password>
note

More information on the keytool command can be found in the Oracle documentation.

Resources

Configuration verification

To verify that authentik is correctly configured with Apache Guacamole, log out and log back in through authentik. You should notice a new button appearing at the bottom left of the login page.