website/integrations/documentation/appflowy/index.mdx
import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs";
AppFlowy is an open-source workspace collaboration platform (similar to Notion) that lets teams create, manage, and collaborate on documents, databases, and projects.
The following placeholders are used in this guide:
appflowy.company is the FQDN of the AppFlowy 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 AppFlowy with authentik, you need to create a certificate and an application/provider pair in authentik.
AppFlowyCertSAML).365).RSAhttps://appflowy.company/gotrue/sso/saml/acsauthentikPosthttps://appflowy.company/gotrue/sso/saml/metadataauthentik default SAML Mapping: Emailhttps://appflowy.company/auth/callbackConfigure AppFlowy Cloud to use authentik as its SAML IdP.
AppFlowy requires the private key in PKCS#1 and base64 (single-line) format, so you'll need to convert the certificate and private key to these formats.
<Tabs> <TabItem value="linuxmac" label="Linux and MacOS" default>openssl rsa -in <certificate_private_key>.pem -traditional -out key_pkcs1.pem
sed -n '/^-----BEGIN RSA PRIVATE KEY-----$/,/^-----END RSA PRIVATE KEY-----$/p' key_pkcs1.pem | grep -v '^-----' | tr -d '\n'
The output of this command will be required for the GOTRUE_SAML_PRIVATE_KEY value in a later section.
\n escapes:awk 'NF {sub(/\r/, ""); printf "%s\\n",$0}' <certificate>.pem
The output of this command will be required for the AUTH_SAML_CERT value in a later section. See the AppFlowy documentation for more information.
openssl rsa -in <certificate_private_key>.pem -traditional -out key_pkcs1.pem
(Get-Content key_pkcs1.pem) -join "`n" `
| Select-String -Pattern '^-{5}' -NotMatch `
| ForEach-Object { $_ -replace '\s','' } `
| ForEach-Object { $_ } `
| Out-String -Stream | ForEach-Object { $_.Trim() }
\n escapes:(Get-Content <certificate>.pem) `
| ForEach-Object { ($_ -replace "`r","") + "\n" } `
| Out-String -Stream `
| ForEach-Object { $_.TrimEnd() } `
| ForEach-Object { $_ -replace "`n", "\\n" }
The output of this command will be required for the AUTH_SAML_CERT value in a later section.
https://appflowy.company/console.Add the following environment variables to your AppFlowy installation:
AUTH_SAML_ENABLED=true
GOTRUE_SAML_ENABLED=true
AUTH_SAML_ENTRY_POINT="https://authentik.company/application/saml/<application_slug>/sso/binding/post"
AUTH_SAML_ISSUER="authentik"
AUTH_SAML_CALLBACK_URL="https://appflowy.company/gotrue/sso/saml/acs"
AUTH_SAML_DEFAULT_REDIRECT_URL="https://appflowy.company/app"
# From the conversion steps above
GOTRUE_SAML_PRIVATE_KEY="<Base64 private key (single line)>"
AUTH_SAML_CERT="<Certificate with \\n escapes (single line)>"
:::info
Ensure GOTRUE_DISABLE_SIGNUP=false is set so that first-time SAML users can sign in.
:::
Restart AppFlowy to apply the changes.
To confirm that authentik is properly configured with AppFlowy, log out and then log back in by clicking the application created for AppFlowy in the authentik User interface. You should be automatically redirected and signed in to AppFlowy.