Skip to content

Automagically connect Thundermail Calendar in FTUE#1544

Open
davinotdavid wants to merge 14 commits intomainfrom
ftue-automatic-connect-thundermail-calendar
Open

Automagically connect Thundermail Calendar in FTUE#1544
davinotdavid wants to merge 14 commits intomainfrom
ftue-automatic-connect-thundermail-calendar

Conversation

@davinotdavid
Copy link
Contributor

@davinotdavid davinotdavid commented Feb 26, 2026

Description of the Change

  • Updated docker-compose.yml container ports not to clash with thunderbird-accounts when running locally
  • Added TB_ACCOUNTS_CALDAV_URL env var.
  • Added POST '/caldav/oidc/auth' route to attempt to connect to the CalDAV through the OIDC token.
  • Removed the ConnectYourCalendarThundermailStep as we don't need it anymore + related i18n and enum entries.

Here's the flow:

  • Frontend makes a POST request to /caldav/oidc/auth
  • Appointment's Backend makes a POST request to Account's Backend /appointment/caldav/setup/ passing the APPOINTMENT_CALDAV_SECRET and the current logged in user's OIDC token
  • Account's Backend deletes previously existing App Passwords that match a specific label and creates a new App Password in Stalwart. The password is returned in plain text as we will need it in Appointment's backend to connect to it but it is hashed when saved
  • Appointment's Backend takes the subscriber's email + newly created App Password and connects to the CalDAV server + creates the ExternalConnection entry

Warning

Requires thunderbird/thunderbird-accounts#616 to be merged in first for the best experience on testing this

How to test it

Alright, first of all, this is a joint effort with the thunderbird-accounts repo so make sure you are in the branch appointment-auto-setup-caldav (thunderbird/thunderbird-accounts#469) and you are able to run a docker compose up in both thunderbird-accounts and this branch in Appointment.

Make sure you have the .env var APPOINTMENT_CALDAV_SECRET set in both thunderbird-accounts and this branch to the same values.

Accounts Prerequisites

  • Navigate to the Django Admin in http://localhost:8087/admin and login with user admin@example.org and password admin.
  • Create a Subscription Plan manually in http://localhost:8087/admin/subscription/plan/add/. None of the information here actually matter except for the Product which has to be an active product.
  • Now navigate again to http://localhost:8087/ and you should be redirected to the /subscribe page.
  • Use Paddle's test cards for the checkout.
  • After you are redirected to the dashboard, you are all set!

PS: This whole step is required because only then we will have the authenticate.User model created + the actual Stalwart account to create the App Password.

Steps to test, now in Appointment-land

  • Navigate to http://localhost:8090, if you are redirected to Keycloak, login with the same admin@example.org / admin as before.
  • Go through the FTUE until the step to select which calendar to connect with and select Thundermail Calendar
  • Click Next and see that you are now in the Booking Page step with the Stalwart Calendar pre-selected. All that without manually creating an App Password!

Benefits

  • 1 click configuration for Thundermail Calendar!

Applicable Issues

Fixes #1352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connect to CalDAV with OIDC token

1 participant