Skip to content

Add support for client-side OIDC interstitial redirect#9669

Merged
mitchellhenke merged 27 commits intomainfrom
mitchellhenke/oidc-interstitial-redirect
Dec 6, 2023
Merged

Add support for client-side OIDC interstitial redirect#9669
mitchellhenke merged 27 commits intomainfrom
mitchellhenke/oidc-interstitial-redirect

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented Nov 28, 2023

🛠 Summary of changes

Note: This is very much a draft and still exploratory

Currently, we must keep track of where we may redirect to OIDC partner applications due to the Content Security Policy (CSP) form-action directive. Some browsers (Chrome and Safari) have a stricter implementation of the form-action directive and require that all hosts in the redirect chain be in the form-action directive, which requires us to include all potential redirects in the partner application (since they may redirect on from our redirect).

For example, when someone is authenticating with a service provider and successfully submits a form with their OTP code and is successful, there is potential that we may redirect to the partner application, so we must include all of those in the CSP form-action header via apply_secure_headers_override. It isn't always immediately apparent when this is needed and can lead to bugs (#8063) where a user submits a form and it silently fails with a CSP error logged to the console.

This PR takes a similar approach to what we did in #6894 for SAML by rendering a page with a link that will be clicked by Javascript (and includes a no Javascript fallback where a user can click the link themselves).

Some of the details still need to be worked out, including the content and visuals of the interstitial page.

This change originated from this proposal which includes more discussion on the partner-facing impacts.

@mitchellhenke mitchellhenke requested a review from aduth November 28, 2023 16:38
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/oidc-interstitial-redirect branch from 58ac399 to 5fae0d0 Compare November 29, 2023 15:56
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/oidc-interstitial-redirect branch from 5fae0d0 to 4f4c4cb Compare November 30, 2023 15:00
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/oidc-interstitial-redirect branch 2 times, most recently from 1025204 to 1b776fa Compare November 30, 2023 22:49
@mitchellhenke mitchellhenke marked this pull request as ready for review December 1, 2023 20:34
@mitchellhenke mitchellhenke requested review from a team, Sgtpluck, mmagsa and zachmargolis December 1, 2023 21:07
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

🚀

Comment on lines 10 to 11
Copy link
Contributor

Choose a reason for hiding this comment

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

I recall you'd mentioned earlier wanting to keep the stylesheets in order to show a blue background. I noticed (testing by removing the <meta> tag locally) that the background is white once the page fully loads, because of styles applied to the <body> tag. Technically we could omit the <body> tag here altogether if we wanted that blue background (which is applied to the <html> tag to be visible).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added background to the body tag based on internal discussion in 6c71294

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/oidc-interstitial-redirect branch from 6c71294 to fc95af0 Compare December 6, 2023 15:53
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/oidc-interstitial-redirect branch from fc95af0 to 9e60cb8 Compare December 6, 2023 20:45
@mitchellhenke mitchellhenke merged commit c32405a into main Dec 6, 2023
@mitchellhenke mitchellhenke deleted the mitchellhenke/oidc-interstitial-redirect branch December 6, 2023 21:00
@jmhooper jmhooper mentioned this pull request Dec 12, 2023
@@ -1,3 +1,4 @@
# rubocop:disable Layout/LineLength
Copy link
Contributor

Choose a reason for hiding this comment

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

In retrospect, not sure we should have disabled this for the full file?

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.

3 participants