Skip to content

Commit

Permalink
Allow changing auth URL via auth_url_path parameter (#245)
Browse files Browse the repository at this point in the history
Fixes #243
  • Loading branch information
treydock authored May 12, 2022
1 parent 0ae31a9 commit c22e714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@
# The address of the syslog server. Default 'localhost'.
# @param syslog_format
# Syslog format. Either 'RFC3164' or 'RFC5424' Default 'RFC3164'.
# @param auth_url_path
# The URL path for /auth
class keycloak (
Boolean $manage_install = true,
String $version = '12.0.4',
Expand Down Expand Up @@ -371,6 +373,7 @@
Stdlib::Port $syslog_port = 514,
Stdlib::Host $syslog_server_address = 'localhost',
Enum['RFC3164', 'RFC5424'] $syslog_format = 'RFC3164',
String $auth_url_path = '/auth',
) {

if ! ($facts['os']['family'] in ['RedHat','Debian']) {
Expand Down Expand Up @@ -494,7 +497,7 @@
keycloak_port => $http_port,
use_ssl => false,
timeout => 60,
test_url => '/auth/realms/master/.well-known/openid-configuration',
test_url => "${auth_url_path}/realms/master/.well-known/openid-configuration",
require => Class['keycloak::service'],
}

Expand Down
2 changes: 1 addition & 1 deletion templates/kcadm-wrapper.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

KCADM="<%= scope['keycloak::install_base'] %>/bin/kcadm.sh"

${KCADM} "$@" --no-config --server http://localhost:<%= scope['keycloak::http_port'] %>/auth --realm master --user <%= scope['keycloak::admin_user'] %> --password <%= scope['keycloak::admin_user_password'] %>
${KCADM} "$@" --no-config --server http://localhost:<%= scope['keycloak::http_port'] %><%= scope['keycloak::auth_url_path'] %> --realm master --user <%= scope['keycloak::admin_user'] %> --password <%= scope['keycloak::admin_user_password'] %>

0 comments on commit c22e714

Please sign in to comment.