Skip to content

Add CORS headers to the tsh login callback#39696

Merged
espadolini merged 2 commits intomasterfrom
espadolini/tsh-login-cors
Mar 22, 2024
Merged

Add CORS headers to the tsh login callback#39696
espadolini merged 2 commits intomasterfrom
espadolini/tsh-login-cors

Conversation

@espadolini
Copy link
Copy Markdown
Contributor

@espadolini espadolini commented Mar 21, 2024

This PR adds CORS response headers for preflight requests on /callback during the tsh login SSO login flow, which might become necessary in the future since it's a requirement that has been added and removed several times to Google Chrome (most recently discussed in https://issues.chromium.org/issues/330364341).

Before this PR, launching Chrome with --enable-features=PrivateNetworkAccessForNavigations and going through tsh login results in a successful tsh login but a broken page in the browser; after this PR, the browser is successfully redirected to the "Login successful" page.

In addition, this PR makes it so that in the future (v17) we can have the proxy POST the callback data to tsh rather than relying on a redirect.

changelog: fix broken SSO login landing page on certain versions of Google Chrome

Copy link
Copy Markdown
Contributor

@jentfoo jentfoo left a comment

Choose a reason for hiding this comment

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

LGTM

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from EdwardDowling March 21, 2024 19:17
@espadolini espadolini force-pushed the espadolini/tsh-login-cors branch from e48a2f7 to f7ee4f3 Compare March 22, 2024 10:43
@espadolini espadolini added this pull request to the merge queue Mar 22, 2024
Merged via the queue into master with commit 270205f Mar 22, 2024
@espadolini espadolini deleted the espadolini/tsh-login-cors branch March 22, 2024 13:07
@public-teleport-github-review-bot
Copy link
Copy Markdown

@espadolini See the table below for backport results.

Branch Result
branch/v13 Create PR
branch/v14 Create PR
branch/v15 Create PR

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants