Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CORS headers to the tsh login callback #39696

Merged
merged 2 commits into from
Mar 22, 2024
Merged

Conversation

espadolini
Copy link
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
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
34 checks passed
@espadolini espadolini deleted the espadolini/tsh-login-cors branch March 22, 2024 13:07
@public-teleport-github-review-bot

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants