Commit 9b0c8ef9 authored by Clément OUDOT's avatar Clément OUDOT
Browse files

SAML: use serviceToXML

parent 6f46631f
......@@ -732,7 +732,7 @@ sub defaultConf {
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
.'http://auth.example.com/saml/singleSignOn;',
samlIDPSSODescriptorSingleSignOnServiceSOAP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-SOAP;'
'urn:oasis:names:tc:SAML:2.0:bindings:SOAP;'
.'http://auth.example.com/saml/singleSignOnSOAP;',
samlIDPSSODescriptorSingleLogoutServiceHTTP =>
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect;'
......
......@@ -24,33 +24,21 @@ sub authInit {
# Activate SOAP
$self->{Soap} = 1;
# Check presence of service metadata and private key in configuration
unless ($self->{samlServiceMetaData}
and $self->{samlServicePrivateKey} )
{
$self->lmLog(
"SAML service metadata or private key not found in configuration",
'error' );
# Check presence of private key in configuration
unless ( $self->{samlServicePrivateKey} ) {
$self->lmLog( "SAML private key not found in configuration", 'error' );
return PE_ERROR;
}
# Get metadata from configuration
$self->lmLog( "Get Metadata for this service", 'debug' );
my $service_metadata = Lemonldap::NG::Common::Conf::SAML::Metadata->new();
unless (
$service_metadata->initializeFromConfHash(
$self->{samlServiceMetaData}
)
)
{
$self->lmLog( "Fail to read Service Metadata from configuration",
'error' );
return PE_ERROR;
}
# Create Lasso server with service metadata
my $server = $self->createServer(
$service_metadata->toXML(),
$service_metadata->serviceToXML(
$ENV{DOCUMENT_ROOT} . "/skins/common/saml2-metadata.tpl", $self
),
$self->{samlServicePrivateKey},
);
......
......@@ -117,7 +117,7 @@ sub createServer {
$private_key_password, $certificate );
};
$self->checkLassoError($@);
return unless $self->checkLassoError($@);
return $server;
}
......
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