From 0ae2585a9792869c7d6b97d09f47bb1a495306fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Fri, 9 Apr 2010 16:42:50 +0000 Subject: [PATCH] SAML: manage artifact (work in progess) --- .../lib/Lemonldap/NG/Portal/IssuerDBSAML.pm | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm index d5cc4ab6b..6399c01a4 100644 --- a/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm +++ b/modules/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/IssuerDBSAML.pm @@ -125,8 +125,29 @@ sub issuerForUnAuthUser { my $artifact_id = $login->assertionArtifact(); - # Load artifact message - $self->{SOAPMessage} = $self->loadArtifact($artifact_id); + # Load artifact message into login response + my $art_message = $self->loadArtifact($artifact_id); + eval { $login->response( Lasso::Node::new_from_dump($art_message) ); }; + if ($@) { + $self->checkLassoError($@); + $self->lmLog( "Cannot load response", 'error' ); + return PE_ERROR; + } + + $self->lmLog( "Response loaded", 'debug' ); + + # Build artifact response + eval { Lasso::Login::build_response_msg($login); }; + if ($@) { + $self->checkLassoError($@); + $self->lmLog( "Cannot build artifact response", 'error' ); + return PE_ERROR; + } + $self->lmLog( "Artifact response built", 'debug' ); + + $self->{SOAPMessage} = $login->msg_body; + + $self->lmLog( "Send SOAP Message: " . $self->{SOAPMessage}, 'debug' ); # Return SOAP message $self->returnSOAPMessage(); @@ -263,7 +284,7 @@ sub issuerForAuthUser { # Get artifact ID and Content, and store them my $artifact_id = $login->assertionArtifact; - my $artifact_message = $login->response->export_to_xml; + my $artifact_message = $login->response->dump; $self->storeArtifact( $artifact_id, $artifact_message ); }