From 1b30b10ad9d3cee9fbab91c473bbf4f8ee7bbedb Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Wed, 26 Jan 2005 13:52:12 +0000 Subject: Added SWIG binding for lasso_session_get_assertions. Also added Java code to test it. --- java/tests/LoginTest.java | 5 +++-- swig/Lasso.i | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/java/tests/LoginTest.java b/java/tests/LoginTest.java index a346570a..7ae9f568 100644 --- a/java/tests/LoginTest.java +++ b/java/tests/LoginTest.java @@ -85,6 +85,7 @@ public class LoginTest extends TestCase { Identity idpIdentity, spIdentity; Login idpLogin, spLogin; Logout idpLogout, spLogout; + SamlAssertion assertion; Server idp, sp; Session idpSession, spSession; String artifact, authenticationMethod, authnRequestQuery, authnRequestUrl, idpDump, @@ -179,8 +180,8 @@ public class LoginTest extends TestCase { assertNotNull(spSession); spSessionDump = spSession.dump(); assertNotNull(spSessionDump); - // FIXME: To uncomment. - // authenticationMethod = spSession.getAuthenticationMethod("https://idp1/metadata"); + assertion = (SamlAssertion) spSession.getAssertions("https://idp1/metadata").getItem(0); + authenticationMethod = assertion.getAuthenticationStatement().getAuthenticationMethod(); assertEquals(lasso.SAML_AUTHENTICATION_METHOD_PASSWORD, authenticationMethod); // Service provider logout. diff --git a/swig/Lasso.i b/swig/Lasso.i index 3725528f..21d74a23 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -5054,6 +5054,9 @@ typedef struct { %newobject dump; char *dump(); + + %newobject getAssertions; + LassoNodeList *getAssertions(char *providerId); } %{ @@ -5082,6 +5085,20 @@ LassoStringList *LassoSession_providerIds_get(LassoSession *self) { #define LassoSession_dump lasso_session_dump +LassoNodeList *LassoSession_getAssertions(LassoSession *self, char *providerId) { + GPtrArray *assertionsArray; + GList *assertionsList; + + assertionsList = lasso_session_get_assertions(self, providerId); + if (assertionsList) { + assertionsArray = get_node_list(assertionsList); + g_list_foreach(assertionsList, (GFunc) free_node_list_item, NULL); + g_list_free(assertionsList); + } else + assertionsArray = NULL; + return assertionsArray; +} + %} -- cgit