Commit 21206099 authored by Christophe Maudoux's avatar Christophe Maudoux

Append display options for SAML IDP (#1637)

parent 0528f78d
......@@ -37,7 +37,7 @@ sub init {
my @list = ();
my $portalPath = $self->conf->{portal};
$portalPath =~ s#^https?://[^/]+/?#/#;
#$portalPath =~ s#^https?://[^/]+/?#/#;
foreach (@tab) {
my $name = $self->conf->{oidcOPMetaDataOptions}->{$_}
......
......@@ -939,11 +939,26 @@ sub extractFormInfo {
# IDP list
my @list = ();
my $portalPath = $self->conf->{portal};
foreach ( keys %{ $self->idpList } ) {
my $idpName = $self->{idpList}->{$_}->{name};
$idpName = $self->{idpList}->{$_}->{displayName} if $self->{idpList}->{$_}->{displayName};
my $icon = $self->{idpList}->{$_}->{icon};
my $img_src = '';
if ($icon) {
$img_src =
( $icon =~ m#^https?://# )
? $icon
: $portalPath . $self->p->staticPrefix . "/common/" . $icon;
}
$self->logger->debug("IDP " . $self->{idpList}->{$_}->{name} . " -> DisplayName : $idpName with Icon = $img_src");
push @list,
{
val => $_,
name => $self->idpList->{$_}->{name}
name => $idpName,
icon => $img_src,
};
}
$req->data->{list} = \@list;
......
......@@ -268,9 +268,6 @@ sub loadIDPs {
$self->idpList->{$entityID}->{confKey} = $_;
$self->idpList->{$entityID}->{name} = $name;
#####################
# Set encryption mode
my $encryption_mode = $self->conf->{samlIDPMetaDataOptions}->{$_}
->{samlIDPMetaDataOptionsEncryptionMode};
......@@ -289,6 +286,13 @@ sub loadIDPs {
}
$self->logger->debug("Set encryption mode $encryption_mode on IDP $_");
# Set display options
$self->idpList->{$entityID}->{displayName} =
$self->conf->{samlIDPMetaDataOptions}->{$_}->{samlIDPMetaDataOptionsDisplayName};
$self->idpList->{$entityID}->{icon} =
$self->conf->{samlIDPMetaDataOptions}->{$_}->{samlIDPMetaDataOptionsIcon};
# Set rule
my $cond = $self->conf->{samlIDPMetaDataOptions}->{$_}
->{samlIDPMetaDataOptionsResolutionRule};
if ( length $cond ) {
......
......@@ -18,7 +18,7 @@
<input type="hidden" name="skin" value="<TMPL_VAR NAME="SKIN">" />
<div class="card border-info">
<div class="card-header text-white bg-info">
<div class="card-header text-white bg-info text-center">
<h3 class="card-title">
<span trspan="selectIdP">Select your Identity Provider</span>
</h3>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment