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

Allow authentication in deploy previews #328

Open
jasonaowen opened this issue Sep 20, 2023 · 2 comments
Open

Allow authentication in deploy previews #328

jasonaowen opened this issue Sep 20, 2023 · 2 comments

Comments

@jasonaowen
Copy link
Contributor

Keycloak does not currently support wildcards in redirect-uris. We accepted this lack of out-of-the-box support in Phase I, but here at the beginning of Phase II it is worth re-evaluating our options for a key workflow.

(Follow-up from a conversation on PR #327.)

@jasonaowen
Copy link
Contributor Author

It's looking like the new OAuth 2.1 spec (still in development) is going to explicitly forbid wildcards in redirect-uris:

Redirect URIs must be compared using exact string matching

This is apparently already a recommended practice which is being promoted into the specification.

So, even if two years of no progress on the Keycloak side were not already a strong clue, this makes it even less likely.

However, all is not lost: we can automate the thing we've occasionally done by hand. Keycloak has an administrative API, and there is an API endpoint for updating a client; it should be possible to craft a GitHub Action that uses the KeyCloak API to update the client's redirect URI list.

That will involve trusting GitHub with some credentials to modify our KeyCloak instance. I believe we can somewhat restrict the scope of its authorization, but the restrictions might not be as fine-grained as I'd like - ideally, only modifying the redirect URIs of a particular client, but I think it'll be modifying any existing client.

So, it's possible, and probably worth doing, but not as smooth or secure as I'd like.

@reefdog
Copy link
Contributor

reefdog commented Apr 10, 2024

@slifty Notes that one way to brute-force this, thanks to the predictable pattern of deploy domains, is just to add the next 1000 or so generated domains to Keycloak: https://deploy-preview-{n}--philanthropy-data-commons-viewer.netlify.app/

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

No branches or pull requests

2 participants