Hey, we are having a problem. Our SAML XML configu...
# developers
p
Hey, we are having a problem. Our SAML XML configuration isnt accepted, the backend throws this error when trying to paste it in the frontend: Has anyone encountered this before?
2022-06-20T11:11:34.164913000Z @calcom/web:start: Error setting SAML config Error: Invalid key length
2022-06-20T11:11:34.165449000Z @calcom/web:start: at Cipheriv.createCipherBase (internal/crypto/cipher.js:103:19)
2022-06-20T11:11:34.165509000Z @calcom/web:start: at Cipheriv.createCipherWithIV (internal/crypto/cipher.js:121:20)
2022-06-20T11:11:34.165550000Z @calcom/web:start: at new Cipheriv (internal/crypto/cipher.js:227:22)
2022-06-20T11:11:34.165597000Z @calcom/web:start: at Object.createCipheriv (crypto.js:122:10)
2022-06-20T11:11:34.165649000Z @calcom/web:start: at Object.encrypt (/calcom/node_modules/@boxyhq/saml-jackson/dist/db/encrypter.js:12:37)
2022-06-20T11:11:34.165686000Z @calcom/web:start: at DB.<anonymous> (/calcom/node_modules/@boxyhq/saml-jackson/dist/db/db.js:76:29)
2022-06-20T11:11:34.165729000Z @calcom/web:start: at Generator.next (<anonymous>)
2022-06-20T11:11:34.165765000Z @calcom/web:start: at /calcom/node_modules/@boxyhq/saml-jackson/dist/db/db.js:27:71
2022-06-20T11:11:34.165805000Z @calcom/web:start: at new Promise (<anonymous>)
2022-06-20T11:11:34.165843000Z @calcom/web:start: at __awaiter (/calcom/node_modules/@boxyhq/saml-jackson/dist/db/db.js:23:12)
2022-06-20T11:11:34.165875000Z @calcom/web:start: at DB.put (/calcom/node_modules/@boxyhq/saml-jackson/dist/db/db.js:71:16)
2022-06-20T11:11:34.165914000Z @calcom/web:start: at Store.<anonymous> (/calcom/node_modules/@boxyhq/saml-jackson/dist/db/store.js:55:34)
2022-06-20T11:11:34.165953000Z @calcom/web:start: at Generator.next (<anonymous>)
2022-06-20T11:11:34.165991000Z @calcom/web:start: at /calcom/node_modules/@boxyhq/saml-jackson/dist/db/store.js:27:71
2022-06-20T11:11:34.166040000Z @calcom/web:start: at new Promise (<anonymous>)
2022-06-20T11:11:34.166080000Z @calcom/web:start: at __awaiter (/calcom/node_modules/@boxyhq/saml-jackson/dist/db/store.js:23:12)
👀 1
p
@Deepak Prabhakara any ideas?
d
@Philipp Fruh (Virtual-Identity) Looks like an issue with the encryption key, is it 32 bytes as described in the docs?
p
@Deepak Prabhakara Which docs are you talking about? I've only seen the readme's in the repos /ee/ folder.
d
It looks like https://github.com/calcom/cal.com/blob/2362133b252ecf0b85ace0355782c94f9671d0ae/.env.example#L66 is set but not to the correct length of 32 bytes? From the logs it's trying to encrypt the record but fails
p
I've generated it with
openssl rand -base64 32
The resulting string has 44 characters.
d
Might be an issue in decoding the key, checking
Aaha it's
openssl rand -base64 24
, not 32 because base64 is 33% larger
The resulting string should be 32
I thought there was validation for this where the length of the key is verified, will check why it didn't get picked up
p
That was it! Thank you very much :)
❤️ 2
🙌 2
d
You're most welcome 🙂
❤️ 2