Append display options for SAML IDP (#1637)

This commit is contained in:
Christophe Maudoux 2019-02-05 22:39:09 +01:00
parent 0528f78dad
commit 21206099ce
4 changed files with 25 additions and 6 deletions

View File

@ -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}->{$_}

View File

@ -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;

View File

@ -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 ) {

View File

@ -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>