docker icon indicating copy to clipboard operation
docker copied to clipboard

Configuring Single Sign-On

Open chriscroome opened this issue 1 year ago • 10 comments

I've followed the Build and Run Cal.com instructions and everything appears to be working apart from the SSO configuration page at /settings/security/sso, this displays:

Single Sign-On

saml_description

⚠️ unexpected character at line 1 column 1 of the JSON data

I suspect this is because according to the SSO setup instructions an additional database is needed, is there a suggested method for adding an additional database to the PostgreSQL Docker container other than doing it manually?

chriscroome avatar Jun 03 '23 16:06 chriscroome

Have you managed to figure this out? :)

buzzard10 avatar Jun 14 '23 04:06 buzzard10

Not yet, I've been working on other things, I guess manually creating the database is the way to solve this?

chriscroome avatar Jun 14 '23 08:06 chriscroome

In kubernetes we use "init containers" for this type of thing, which is something I'm also migrating to in our org's calcom setup.

Check this out and see if it works for your case here: https://stackoverflow.com/questions/70322031/does-docker-compose-support-init-container You can probably create a busybox or other instance which connects to postgres and runs the create command, then make the calcom service dependent on it's completion.

krumware avatar Jun 14 '23 08:06 krumware

None of these options sound ideal, since the PostgreSQL Docker container is designed to provide one database what about adding an additional PostgreSQL Docker container for the SSO database via the docker-compose.yaml file, would that be a easier option?

chriscroome avatar Jun 16 '23 06:06 chriscroome

I don't know a whole lot about the SSO setup in particular, but that's fairly common in these cases. Just keep an eye out for port conflicts.

Worth noting, if someone is trying to use it with managed database server, that they still may need to run scripts for the database creation. In which case the init container approach could still be relevant.

krumware avatar Jun 16 '23 11:06 krumware

Does anyone have working docker-compose for cal.com with SSO? :)

buzzard10 avatar Jun 16 '23 11:06 buzzard10

you can create an additional DB easily by using psql

psql -h localhost -U unicorn_user

then in that prompt you can just type

create database calenso_saml

Then in your docker compose file

SAML_DATABASE_URL=postgresql://$${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}_saml
[email protected],[email protected]

But it's still not working for me image

andres-asm avatar Jan 08 '24 06:01 andres-asm

Ah no it does! But the feature is behind a paywall... Sad..

image

andres-asm avatar Jan 08 '24 06:01 andres-asm

...

Then in your docker compose file

SAML_DATABASE_URL=postgresql://$${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}_saml
[email protected],[email protected]

...

For anyone else who copy/pasted the environment variables provided by @andres-asm, remove the extra $ before {POSTGRES_USER}

AndrewBucklin avatar Jan 27 '24 23:01 AndrewBucklin

Is this really a enterprise feature? That's a pity, I would have liked to use cal.com.

corius498 avatar May 03 '24 06:05 corius498