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.

Guacamole configuration

It is recommended you configure an admin account in Guacamole before setting up SSO to make things easier. Create a user in Guacamole using the username of your user in authentik and give them admin permissions. Without this, you might lose access to the Guacamole admin settings and have to revert the settings below.

The Docker containers are configured via environment variables. The following variables are required:

OPENID_AUTHORIZATION_ENDPOINT: https://authentik.company/application/o/authorize/
OPENID_CLIENT_ID: # client ID from above
OPENID_ISSUER: https://authentik.company/application/o/*Slug of the application from above*/
OPENID_JWKS_ENDPOINT: https://authentik.company/application/o/*Slug of the application from above*/jwks/
OPENID_REDIRECT_URI: https://guacamole.company/ # This must match the redirect URI above
OPENID_USERNAME_CLAIM_TYPE: preferred_username

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>
  1. 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.