-
Notifications
You must be signed in to change notification settings - Fork 271
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
Fixes #28436 - Add keycloak support #779
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,9 @@ | |
Boolean $ipa_authentication = false, | ||
Hash[String, Any] $http_vhost_options = {}, | ||
Hash[String, Any] $https_vhost_options = {}, | ||
Boolean $keycloak = false, | ||
String[1] $keycloak_app_name = 'foreman-openidc', | ||
String[1] $keycloak_realm = 'ssl-realm', | ||
) { | ||
$docroot = "${app_root}/public" | ||
|
||
|
@@ -226,6 +229,31 @@ | |
include ::apache::mod::intercept_form_submit | ||
include ::apache::mod::lookup_identity | ||
include ::apache::mod::auth_kerb | ||
} elsif $keycloak { | ||
# TODO: https://github.com/puppetlabs/puppetlabs-apache/commit/9f7f38ff21036c9a1ce4d669ccaea816941209ca | ||
# adds apache::mod::auth_openidc which allows for proper integration but | ||
# the current release (5.4.0) doesn't include this yet. | ||
include ::apache::mod::authz_user | ||
apache::mod { 'auth_openidc': | ||
package => 'mod_auth_openidc', | ||
} | ||
|
||
# This file is generated by keycloak-httpd-client-install and that manages | ||
# the content. The command would be: | ||
# | ||
# keycloak-httpd-client-install --app-name ${keycloak_app_name} --keycloak-server-url $KEYCLOAK_URL --keycloak-admin-username $KEYCLOAK_USER --keycloak-realm ${keycloak_realm} --keycloak-admin-realm master --keycloak-auth-role root-admin --client-type openidc --client-hostname ${servername} --protected-locations /users/extlogin | ||
# | ||
# If $suburi is used, --location-root should also be passed in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how much it's used, but if |
||
# | ||
# By defining it here we avoid purging it and also tighten the | ||
# permissions so the world can't read its secrets. | ||
# This is functionally equivalent to apache::custom_config without content/source | ||
file { "${apache::confd_dir}/${keycloak_app_name}_oidc_keycloak_${keycloak_realm}.conf": | ||
ensure => file, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0640', | ||
} | ||
} | ||
|
||
file { "${apache::confd_dir}/${priority}-foreman.d": | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also install keycloak-httpd-client-install package too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was debating that, but decided against it. I think the instruction should be:
yum install keycloak-httpd-client-install
keycloak-httpd-client-install ....
foreman-installer --foreman-keycloak true --foreman-keycloak-realm ...
In theory the installer could run the install command, but then we need to pass credentials and I think that's something we probably don't want.