Added SWIG binding for lasso_session_get_assertions. Also added Java code to
test it.
This commit is contained in:
parent
aaafb05b60
commit
1b30b10ad9
|
@ -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.
|
||||
|
|
17
swig/Lasso.i
17
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;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue