Skip to content

WPB-23422 Mark Cookie with label during SSO Login Flow - #5049

Merged
battermann merged 6 commits into
developfrom
WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event-v3
Feb 23, 2026
Merged

WPB-23422 Mark Cookie with label during SSO Login Flow#5049
battermann merged 6 commits into
developfrom
WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event-v3

Conversation

@battermann

@battermann battermann commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Feb 20, 2026
@battermann
battermann force-pushed the WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event-v3 branch from 56fe858 to b748883 Compare February 20, 2026 10:43
@battermann
battermann marked this pull request as ready for review February 20, 2026 10:55
@battermann
battermann requested review from a team as code owners February 20, 2026 10:55
@battermann
battermann requested a review from Copilot February 20, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for passing an optional cookie label during the SSO (SAML) login flow. This enables clients to mark cookies created during SSO authentication with a specific label (e.g., "shared-device"), which is useful for managing and identifying cookies created on shared or public devices.

Changes:

  • Add optional label query parameter to SSO authentication endpoints (/sso/initiate-login routes)
  • Store cookie label in VerdictFormat and persist it through the SSO flow to Cassandra
  • Pass cookie label to Brig's ssoLogin endpoint to create labeled cookies
  • Add Cassandra schema migration V22 to add cookie_label column to verdict table
  • Add comprehensive integration test verifying cookie label is properly set during SSO flow

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
libs/wire-api/src/Wire/API/User/Auth.hs Add HTTP API data conversion instances for CookieLabel (ToParamSchema, FromHttpApiData, ToHttpApiData)
libs/wire-api/src/Wire/API/User/Saml.hs Add optional cookie label field to VerdictFormat constructors (VerdictFormatWeb, VerdictFormatMobile)
libs/wire-api/src/Wire/API/Routes/Public/Spar.hs Add optional label query parameter to SSO authentication routes (APIAuthReqPrecheck, APIAuthReq)
services/spar/src/Spar/API.hs Thread cookie label parameter through authreq, authreqPrecheck, validateAuthreqParams, and authresp handlers
services/spar/src/Spar/App.hs Pass cookie label from VerdictFormat to verdictHandlerResult and verdictHandlerResultCore
services/spar/src/Spar/Sem/BrigAccess.hs Add Maybe CookieLabel parameter to SsoLogin constructor
services/spar/src/Spar/Sem/BrigAccess/Http.hs Thread cookie label parameter to Intra.ssoLogin call
services/spar/src/Spar/Intra/Brig.hs Pass cookie label to Brig's internal ssoLogin endpoint
services/spar/src/Spar/Data/Instances.hs Update VerdictFormat serialization to include cookie label field
services/spar/src/Spar/Sem/VerdictFormatStore/Cassandra.hs Add cookie label column to Cassandra queries for verdict table
services/spar/src/Spar/Schema/V22.hs Define Cassandra migration to add cookie_label column to verdict table
services/spar/src/Spar/Schema/Run.hs Register V22 migration in migration list
services/spar/spar.cabal Add Spar.Schema.V22 module to cabal file
services/spar/test/Test/Spar/Saml/IdPSpec.hs Update SsoLogin mock to accept label parameter
services/spar/test-integration/Test/Spar/DataSpec.hs Update VerdictFormat test cases to include Nothing label
cassandra-schema.cql Add cookie_label column to verdict table schema
integration/test/Test/Auth.hs Add testSetCookieLabelOnSsoFlow integration test
integration/test/SetupHelpers.hs Add getCookieWithSaml helper and refactor login flow to support label parameter
integration/test/API/Spar.hs Add initiateSamlLoginWithZHostAndLabel helper function
integration/test/API/Nginz.hs Add rotateCookie function (for future cookie management)
integration/test/API/Brig.hs Add getCookies function to query user cookies by labels
changelog.d/2-features/WPB-23422 Add changelog entry for the feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integration/test/API/Spar.hs Outdated
Comment thread integration/test/API/Nginz.hs Outdated
@battermann
battermann merged commit 3b62880 into develop Feb 23, 2026
11 checks passed
@battermann
battermann deleted the WPB-23422-implement-single-shared-device-enforcement-logout-by-cookie-label-logout-event-v3 branch February 23, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants