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 adding custom headers in HTTP Requests performed by keycloak-js adapter #10312

Closed
Toilal opened this issue Feb 18, 2022 · 5 comments
Closed
Labels
kind/enhancement Categorizes a PR related to an enhancement
Milestone

Comments

@Toilal
Copy link

Toilal commented Feb 18, 2022

Description

Would you consider a pull request to configure additional headers when performing HTTP Request to Keycloak inside keycloak-js adapter ?

Discussion

No response

Motivation

I run an SPA communicating with a REST API and using Keycloak for authentication.

This application is deployed on a staging environment that as restricted access to some people through Cloudflare Access (Zero Trust).

In this context, I need keycloak-js adapter to add two headers in every HTTP Request (CF-Access-Client-Id and CF-Access-Client-Secret) for the browser to be allowed to access Keycloak through Cloudflare Access.

Details

No response

@Toilal Toilal added kind/enhancement Categorizes a PR related to an enhancement status/triage labels Feb 18, 2022
Toilal added a commit to Toilal/keycloak that referenced this issue Feb 28, 2022
This adds httpRequestHeaders and httpRequestWillSend init options so end user can send aditionnal headers or perform custom tweaks on http requests before they are sent.

Closes keycloak#10312
@stianst
Copy link
Contributor

stianst commented Mar 1, 2022

I appreciate your problem here, but not convinced we should add support for setting http headers, as it's not compatible with the spec, and additionally since it's a public client it these secrets are not actually secret, so it's a bit of a broken approach to locking it down it seems.

@stianst
Copy link
Contributor

stianst commented Mar 1, 2022

@jonkoops wdyt?

@jonkoops
Copy link
Contributor

jonkoops commented Mar 1, 2022

See my comment on the PR #10313 (comment)

@jonkoops
Copy link
Contributor

jonkoops commented Mar 1, 2022

Closing this for the reasons specified in the PR

@Toilal
Copy link
Author

Toilal commented Mar 1, 2022

Client is also protected behind cloudflare zero trust, but I understand the use case is not so common.

@stianst stianst modified the milestone: 18.0.0 Mar 30, 2022
@stianst stianst added this to the 18.0.0 milestone Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Categorizes a PR related to an enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants