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

Set keycloak-authorization proxy url #14778

Merged

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Feb 2, 2021

Fixes #14733

This PR sets it as for example localhost:80.

Keycloak adapter code checks it like this:

URI uri = URI.create(adapterConfig.getProxyUrl());
this.proxyHost = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme());

where the scheme is defaulted to http which users can override by setting the host to https://localhost etc

@@ -114,6 +114,10 @@ public void init(OidcConfig oidcConfig, KeycloakPolicyEnforcerConfig config, Tls
adapterConfig.setAllowAnyHostname(true);
}

if (oidcConfig.defaultTenant.proxy.host.isPresent()) {
adapterConfig.setProxyUrl(oidcConfig.defaultTenant.proxy.host.get() + ":" + oidcConfig.defaultTenant.proxy.port);
Copy link
Contributor

Choose a reason for hiding this comment

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

No checks against proxy.port?

Copy link
Member Author

Choose a reason for hiding this comment

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

@gastaldi It is defaulted to 80

Copy link
Contributor

@pedroigor pedroigor left a comment

Choose a reason for hiding this comment

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

@sberyozkin LGTM, except for @gastaldi comment.

Did you define a default port for quarkus-oidc?

@sberyozkin
Copy link
Member Author

@pedroigor Yeah :-) OidcCommonConfig.proxy

@sberyozkin
Copy link
Member Author

MP tests have failed, not related

@sberyozkin
Copy link
Member Author

Thanks, since it was only MP related build which failed I'll merge, CI seems unstable right now otherwise...

@sberyozkin sberyozkin merged commit 467a587 into quarkusio:master Feb 3, 2021
@sberyozkin sberyozkin deleted the keycloak_authorization_proxy branch February 3, 2021 21:24
@gsmet gsmet modified the milestones: 1.12 - master, 1.11.2.Final Feb 8, 2021
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.

Use proxy setting for keycloak policy enforcer
4 participants