Add an option to encode Metadata in UTF-8 (#119)

This commit is contained in:
Clément Oudot 2010-06-28 09:11:59 +00:00
parent f5367d4dc9
commit 3ee1e9b393
2 changed files with 10 additions and 0 deletions

View File

@ -378,6 +378,8 @@ sub setDefaultValues {
$self->{samlIdPResolveCookie} ||= $self->{cookieName} . "idp";
$self->{samlStorage} ||= $self->{globalStorage};
$self->{samlStorageOptions} ||= $self->{globalStorageOptions};
$self->{samlMetadataForceUTF8} = 1
unless ( defined( $self->{samlMetadataForceUTF8} ) );
}
##@method protected void setHiddenFormValue(string fieldname, string value)

View File

@ -205,6 +205,10 @@ sub loadIDPs {
);
}
if ( $self->{samlMetadataForceUTF8} ) {
$idp_metadata = encode( "utf8", $idp_metadata );
}
# Add this IDP to Lasso::Server
my $result = $self->addIDP( $self->{_lassoServer}, $idp_metadata );
@ -298,6 +302,10 @@ sub loadSPs {
);
}
if ( $self->{samlMetadataForceUTF8} ) {
$sp_metadata = encode( "utf8", $sp_metadata );
}
# Add this SP to Lasso::Server
my $result = $self->addSP( $self->{_lassoServer}, $sp_metadata );