Outline Integration Issue With authentik

Hello,

I was wondering if anyone successfully got the outline application working with authentik? I followed a guide on YouTube and the authentik outline documentation, but I redirected to https://outline.domain.tld/?notice=auth-error with the below error.

Authentication failed – we were unable to sign you in at this time. Please try again.

Here are some of my configuration:

outline Provider

  • Authorization flow: default-provider-authorization-explicit-consent (Authorize Application)
  • Redirect URIs: Strict https://outline.domain.tld/auth/oidc.callback
  • Signing Key: outline (Generated via authentik)
  • Encryption Key: outline (Generated via authentik)
  • Authentication flow: default-authentication-flow (Welcome to authentik!)
  • (everything else left as default)

I got the below error from outline log for Invalid key length on the SECRET_KEY environment variable, but on the app configuration, I set the Secret Key field to the correct length of 64 characters.

outline Log

2025-07-06 16:06:03.522896+00:00{"error":"Invalid key length","level":"error","message":"Failed to encrypt database column (accessToken). The SECRET_KEY environment variable is not the correct length.","stack":"RangeError: Invalid key length\n    at Cipheriv.createCipherBase (node:internal/crypto/cipher:121:19)\n    at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:133:3)\n    at new Cipheriv (node:internal/crypto/cipher:234:3)\n    at Object.createCipheriv (node:crypto:143:10)\n    at Object.createCipheriv (/opt/outline/node_modules/dd-trace/packages/datadog-instrumentations/src/crypto.js:29:27)\n    at UserAuthentication.set (/opt/outline/node_modules/sequelize-encrypted/index.js:48:33)\n    at UserAuthentication.set (/opt/outline/build/server/models/decorators/Encrypted.js:55:59)\n    at UserAuthentication.set (/opt/outline/node_modules/sequelize/lib/model.js:2256:32)\n    at UserAuthentication.set (/opt/outline/node_modules/sequelize/lib/model.js:2241:18)\n    at UserAuthentication._initValues (/opt/outline/node_modules/sequelize/lib/model.js:156:10)\n    at new Model (/opt/outline/node_modules/sequelize/lib/model.js:116:10)\n    at new Model (/opt/outline/node_modules/sequelize-typescript/dist/model/model/model.js:14:9)\n    at new Model (/opt/outline/build/server/models/base/Model.js:23:5)\n    at new IdModel (/opt/outline/build/server/models/base/IdModel.js:19:5)\n    at new UserAuthentication (/opt/outline/build/server/models/UserAuthentication.js:29:5)\n    at new user_authentication (/opt/outline/build/server/models/decorators/Fix.js:21:7)"}
2025-07-06 16:06:03.523873+00:00{"error":"Invalid key length","level":"error","message":"Error during authentication","stack":"RangeError: Invalid key length\n    at Cipheriv.createCipherBase (node:internal/crypto/cipher:121:19)\n    at Cipheriv.createCipherWithIV (node:internal/crypto/cipher:133:3)\n    at new Cipheriv (node:internal/crypto/cipher:234:3)\n    at Object.createCipheriv (node:crypto:143:10)\n    at Object.createCipheriv (/opt/outline/node_modules/dd-trace/packages/datadog-instrumentations/src/crypto.js:29:27)\n    at UserAuthentication.set (/opt/outline/node_modules/sequelize-encrypted/index.js:48:33)\n    at UserAuthentication.set (/opt/outline/build/server/models/decorators/Encrypted.js:55:59)\n    at UserAuthentication.set (/opt/outline/node_modules/sequelize/lib/model.js:2256:32)\n    at UserAuthentication.set (/opt/outline/node_modules/sequelize/lib/model.js:2241:18)\n    at UserAuthentication._initValues (/opt/outline/node_modules/sequelize/lib/model.js:156:10)\n    at new Model (/opt/outline/node_modules/sequelize/lib/model.js:116:10)\n    at new Model (/opt/outline/node_modules/sequelize-typescript/dist/model/model/model.js:14:9)\n    at new Model (/opt/outline/build/server/models/base/Model.js:23:5)\n    at new IdModel (/opt/outline/build/server/models/base/IdModel.js:19:5)\n    at new UserAuthentication (/opt/outline/build/server/models/UserAuthentication.js:29:5)\n    at new user_authentication (/opt/outline/build/server/models/decorators/Fix.js:21:7)"}

Thanks to Stavros Kois’s help on an GitHub Issue, was able to figure out that the Secret Key need to be generated as a 64 character hex. The source doc provided suggest using the below.

openssl rand -hex 32

Everything worked fine after I generated a 64 character hex key instead of just a 64 character password.