summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-07-25 19:29:26 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-07-25 19:29:26 +0000
commit5c73b6167694372c9722401c3f05c8df15382065 (patch)
treefb41bdb13a6a94345fef83151d92296db6ff11cb
parent614ac78aa0bda9d7fcf1ef534bdf069777b84065 (diff)
downloadlasso-5c73b6167694372c9722401c3f05c8df15382065.tar.gz
lasso-5c73b6167694372c9722401c3f05c8df15382065.tar.xz
lasso-5c73b6167694372c9722401c3f05c8df15382065.zip
Java unit test is again similar to Python.
Corrected Java binding to pass the unit test both with Kaffe and Sun JRE. Added a small new test in Python unit test.
-rw-r--r--java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c1
-rw-r--r--java/src/c/com_entrouvert_lasso_LassoLogin.c12
-rw-r--r--java/src/c/com_entrouvert_lasso_LassoLogout.c67
-rw-r--r--java/src/c/com_entrouvert_lasso_LassoProfileContext.c84
-rw-r--r--java/src/java/com/entrouvert/lasso/Lasso.java8
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java1
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java1
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoLogin.java2
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoLogout.java14
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoProfileContext.java49
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoRequest.java1
-rw-r--r--java/src/java/com/entrouvert/lasso/LassoServer.java1
-rw-r--r--java/tests/LoginTest.java10
-rw-r--r--python/tests/login_tests.py1
14 files changed, 163 insertions, 89 deletions
diff --git a/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c b/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c
index a71af821..31239ef3 100644
--- a/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c
+++ b/java/src/c/com_entrouvert_lasso_LassoAuthnRequest.c
@@ -30,6 +30,7 @@ JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoAuthnRequest_init
(JNIEnv * env, jobject this, jstring _providerID){
LassoNode * request;
char * providerID;
+
providerID = (char*)(*env)->GetStringUTFChars(env, _providerID, NULL);
request = lasso_authn_request_new(providerID);
diff --git a/java/src/c/com_entrouvert_lasso_LassoLogin.c b/java/src/c/com_entrouvert_lasso_LassoLogin.c
index 5da86e00..7824cd5d 100644
--- a/java/src/c/com_entrouvert_lasso_LassoLogin.c
+++ b/java/src/c/com_entrouvert_lasso_LassoLogin.c
@@ -293,18 +293,6 @@ JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogin_getAssertionArtif
return (*env)->NewStringUTF(env, result);
}
-JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogin_getNameIdentifier
-(JNIEnv * env, jobject this){
- LassoLogin * login;
- char *result;
-
- login = getCObject(env, this);
-
- result = login->nameIdentifier;
-
- return (*env)->NewStringUTF(env, result);
-}
-
JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogin_getProtocolProfile
(JNIEnv * env, jobject this){
LassoLogin * login;
diff --git a/java/src/c/com_entrouvert_lasso_LassoLogout.c b/java/src/c/com_entrouvert_lasso_LassoLogout.c
index 62f34020..5601a6ce 100644
--- a/java/src/c/com_entrouvert_lasso_LassoLogout.c
+++ b/java/src/c/com_entrouvert_lasso_LassoLogout.c
@@ -28,23 +28,20 @@
#include <lasso/lasso.h>
JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoLogout_init
-(JNIEnv * env, jobject this, jobject _server,
- jobject _user,
- jint _providerType){
+(JNIEnv * env, jobject this, jint _providerType, jobject _server, jobject _user){
LassoLogout *logout;
LassoServer* server;
- LassoUser* user;
+ LassoUser* user = NULL;
server = (LassoServer*)getCObject(env, _server);
- user = (LassoUser*)getCObject(env, _user);
+ if (_user != NULL)
+ user = (LassoUser*)getCObject(env, _user);
- logout = lasso_logout_new(server, user, _providerType);
+ logout = lasso_logout_new(_providerType, server, user);
storeCObject(env, this, logout);
}
-
-
JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_buildRequestMsg
(JNIEnv * env, jobject this){
int result;
@@ -56,7 +53,6 @@ JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_buildRequestMsg
return result;
}
-
JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_buildResponseMsg
(JNIEnv * env, jobject this){
int result;
@@ -68,6 +64,18 @@ JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_buildResponseMsg
return result;
}
+JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogout_getNameIdentifier
+(JNIEnv * env, jobject this){
+ LassoLogout * logout;
+ char *result;
+
+ logout = getCObject(env, this);
+
+ result = logout->nameIdentifier;
+ if (result == NULL)
+ return NULL;
+ return (*env)->NewStringUTF(env, result);
+}
JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogout_getNextProviderId
(JNIEnv * env, jobject this){
@@ -81,7 +89,6 @@ JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoLogout_getNextProviderI
return (*env)->NewStringUTF(env, result);
}
-
JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_initRequest
(JNIEnv * env, jobject this, jstring _providerID){
int result;
@@ -100,9 +107,8 @@ JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_initRequest
return result;
}
-JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processRequestMsg
-(JNIEnv * env, jobject this, jstring _requestMsg,
- jint _requestMethod){
+JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_loadRequestMsg
+(JNIEnv * env, jobject this, jstring _requestMsg, jint _requestMethod){
int result;
LassoLogout* logout;
char *requestMsg;
@@ -110,18 +116,39 @@ JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processRequestMsg
requestMsg = (char*)(*env)->GetStringUTFChars(env, _requestMsg, NULL);
logout = getCObject(env, this);
- result = lasso_logout_process_request_msg(logout,
- requestMsg,
- _requestMethod);
+ result = lasso_logout_load_request_msg(logout, requestMsg, _requestMethod);
(*env)->ReleaseStringUTFChars(env, _requestMsg, requestMsg);
return result;
}
+JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_loadUserDump
+(JNIEnv * env, jobject this, jstring _userDump){
+ int result;
+ LassoLogout* logout;
+ char *userDump;
+
+ userDump = (char*)(*env)->GetStringUTFChars(env, _userDump, NULL);
+
+ logout = getCObject(env, this);
+ result = lasso_logout_load_user_dump(logout, userDump);
+
+ (*env)->ReleaseStringUTFChars(env, _userDump, userDump);
+
+ return result;
+}
+
+JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processRequest
+(JNIEnv * env, jobject this){
+ LassoLogout* logout;
+
+ logout = getCObject(env, this);
+ return lasso_logout_process_request(logout);
+}
+
JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processResponseMsg
-(JNIEnv * env, jobject this, jstring _responseMsg,
- jint _responseMethod){
+(JNIEnv * env, jobject this, jstring _responseMsg, jint _responseMethod){
int result;
LassoLogout* logout;
char *responseMsg;
@@ -129,9 +156,7 @@ JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoLogout_processResponseMsg
responseMsg = (char*)(*env)->GetStringUTFChars(env, _responseMsg, NULL);
logout = getCObject(env, this);
- result = lasso_logout_process_response_msg(logout,
- responseMsg,
- _responseMethod);
+ result = lasso_logout_process_response_msg(logout, responseMsg, _responseMethod);
(*env)->ReleaseStringUTFChars(env, _responseMsg, responseMsg);
diff --git a/java/src/c/com_entrouvert_lasso_LassoProfileContext.c b/java/src/c/com_entrouvert_lasso_LassoProfileContext.c
index 4ac339a0..932c167c 100644
--- a/java/src/c/com_entrouvert_lasso_LassoProfileContext.c
+++ b/java/src/c/com_entrouvert_lasso_LassoProfileContext.c
@@ -26,80 +26,85 @@
#include <lasso/lasso.h>
#include <com_entrouvert_lasso_LassoProfileContext.h>
-JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getProviderID
+JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgBody
(JNIEnv * env, jobject this){
LassoProfileContext * profileContext;
char * result;
profileContext = getCObject(env, this);
- result = profileContext->remote_providerID;
+ result = profileContext->msg_body;
return (*env)->NewStringUTF(env, result);
}
-JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgUrl
+JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgRelayState
(JNIEnv * env, jobject this){
LassoProfileContext * profileContext;
char * result;
profileContext = getCObject(env, this);
- result = profileContext->msg_url;
+ result = profileContext->msg_relayState;
return (*env)->NewStringUTF(env, result);
}
-JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgBody
+JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgUrl
(JNIEnv * env, jobject this){
LassoProfileContext * profileContext;
char * result;
profileContext = getCObject(env, this);
- result = profileContext->msg_body;
+ result = profileContext->msg_url;
return (*env)->NewStringUTF(env, result);
}
-JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getMsgRelayState
+JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getNameIdentifier
+(JNIEnv * env, jobject this){
+ LassoProfileContext * profileContext;
+ char *result;
+
+ profileContext = getCObject(env, this);
+
+ result = profileContext->nameIdentifier;
+ if (result == NULL)
+ return NULL;
+ return (*env)->NewStringUTF(env, result);
+}
+
+JNIEXPORT jstring JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getProviderID
(JNIEnv * env, jobject this){
LassoProfileContext * profileContext;
char * result;
profileContext = getCObject(env, this);
- result = profileContext->msg_relayState;
+ result = profileContext->remote_providerID;
return (*env)->NewStringUTF(env, result);
}
-JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initServerField
+JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getRequestType
(JNIEnv * env, jobject this){
LassoProfileContext * profileContext;
- char * fieldName = "server";
- char * fieldType = "Lcom/entrouvert/lasso/LassoServer;";
- char * javaObjectClassName = "com/entrouvert/lasso/LassoServer";
- LassoServer *cObject;
+ char * result;
profileContext = getCObject(env, this);
- cObject = profileContext->server;
- checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject);
+ return profileContext->request_type;
}
-JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initUserField
+JNIEXPORT jint JNICALL Java_com_entrouvert_lasso_LassoProfileContext_getResponseType
(JNIEnv * env, jobject this){
LassoProfileContext * profileContext;
- char * fieldName = "user";
- char * fieldType = "Lcom/entrouvert/lasso/LassoUser;";
- char * javaObjectClassName = "com/entrouvert/lasso/LassoUser";
- LassoUser *cObject;
+ char * result;
profileContext = getCObject(env, this);
- cObject = profileContext->user;
- checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject);
+ return profileContext->response_type;
}
JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initRequestField
@@ -113,14 +118,13 @@ JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initRequest
profileContext = getCObject(env, this);
cObject = profileContext->request;
- if(profileContext->request_type == lassoMessageTypeAuthnRequest){
+ if (profileContext->request_type == lassoMessageTypeAuthnRequest) {
javaObjectClassName = "com/entrouvert/lasso/LassoAuthnRequest";
- }else if(profileContext->request_type == lassoMessageTypeRequest){
+ } else if(profileContext->request_type == lassoMessageTypeRequest) {
javaObjectClassName = "com/entrouvert/lasso/LassoRequest";
- }else{
+ } else {
/* FIXME: Throw error */
}
-
checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject);
}
@@ -146,3 +150,31 @@ JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initRespons
checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject);
}
+JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initServerField
+(JNIEnv * env, jobject this){
+ LassoProfileContext * profileContext;
+ char * fieldName = "server";
+ char * fieldType = "Lcom/entrouvert/lasso/LassoServer;";
+ char * javaObjectClassName = "com/entrouvert/lasso/LassoServer";
+ LassoServer *cObject;
+
+ profileContext = getCObject(env, this);
+ cObject = profileContext->server;
+
+ checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject);
+}
+
+JNIEXPORT void JNICALL Java_com_entrouvert_lasso_LassoProfileContext_initUserField
+(JNIEnv * env, jobject this){
+ LassoProfileContext * profileContext;
+ char * fieldName = "user";
+ char * fieldType = "Lcom/entrouvert/lasso/LassoUser;";
+ char * javaObjectClassName = "com/entrouvert/lasso/LassoUser";
+ LassoUser *cObject;
+
+ profileContext = getCObject(env, this);
+ cObject = profileContext->user;
+
+ checkAndSetField(env, this, fieldName, fieldType, javaObjectClassName, cObject);
+}
+
diff --git a/java/src/java/com/entrouvert/lasso/Lasso.java b/java/src/java/com/entrouvert/lasso/Lasso.java
index d30ac6e2..bf359e4b 100644
--- a/java/src/java/com/entrouvert/lasso/Lasso.java
+++ b/java/src/java/com/entrouvert/lasso/Lasso.java
@@ -51,6 +51,14 @@ public class Lasso { // Lasso
static final public int loginProtocolProfileBrwsArt = 1;
static final public int loginProtocolProfileBrwsPost = 2;
+ /* Message types */
+ static final public int messageTypeNone = 0;
+ static final public int messageTypeAuthnRequest = 1;
+ static final public int messageTypeAuthnResponse = 2;
+ static final public int messageTypeRequest = 3;
+ static final public int messageTypeResponse = 4;
+ static final public int messageTypeArtifact = 5;
+
/* Provider types */
static final public int providerTypeSp = 1;
static final public int providerTypeIdp = 2;
diff --git a/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java b/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java
index bde492ed..44f863b9 100644
--- a/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java
+++ b/java/src/java/com/entrouvert/lasso/LassoAuthnRequest.java
@@ -25,6 +25,7 @@
package com.entrouvert.lasso;
public class LassoAuthnRequest extends LassoNode { // LassoAuthnRequest
+ private LassoAuthnRequest() {}
public LassoAuthnRequest(String providerID){
init(providerID);
diff --git a/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java b/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java
index 019bf493..de0c7d70 100644
--- a/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java
+++ b/java/src/java/com/entrouvert/lasso/LassoAuthnResponse.java
@@ -25,6 +25,7 @@
package com.entrouvert.lasso;
public class LassoAuthnResponse { // LassoAuthnResponse
+ private LassoAuthnResponse() {}
public LassoAuthnResponse(String providerID, LassoNode request){
init(providerID, request);
diff --git a/java/src/java/com/entrouvert/lasso/LassoLogin.java b/java/src/java/com/entrouvert/lasso/LassoLogin.java
index 071d715c..f8e1655c 100644
--- a/java/src/java/com/entrouvert/lasso/LassoLogin.java
+++ b/java/src/java/com/entrouvert/lasso/LassoLogin.java
@@ -71,8 +71,6 @@ public class LassoLogin extends LassoProfileContext { // LassoLogin
native public String getAssertionArtifact();
- native public String getNameIdentifier();
-
native public int getProtocolProfile();
native public String getResponseDump();
diff --git a/java/src/java/com/entrouvert/lasso/LassoLogout.java b/java/src/java/com/entrouvert/lasso/LassoLogout.java
index d5c465a2..4c9fddca 100644
--- a/java/src/java/com/entrouvert/lasso/LassoLogout.java
+++ b/java/src/java/com/entrouvert/lasso/LassoLogout.java
@@ -26,23 +26,29 @@ package com.entrouvert.lasso;
public class LassoLogout extends LassoProfileContext { // LassoLogout
- public LassoLogout(LassoServer server, LassoUser user, int providerType){
+ public LassoLogout(int providerType, LassoServer server, LassoUser user){
this.server = server;
this.user = user;
- init(server, user, providerType);
+ init(providerType, server, user);
}
- native protected void init(LassoServer server, LassoUser user, int providerType);
+ native protected void init(int providerType, LassoServer server, LassoUser user);
native public int buildRequestMsg();
native public int buildResponseMsg();
+ native public String getNameIdentifier();
+
native public String getNextProviderId();
native public int initRequest(String providerId);
- native public int processRequestMsg(String requestMsg, int requestMethod);
+ native public int loadRequestMsg(String requestMsg, int requestMethod);
+
+ native public int loadUserDump(String userDump);
+
+ native public int processRequest();
native public int processResponseMsg(String responseMsg, int responseMethod);
diff --git a/java/src/java/com/entrouvert/lasso/LassoProfileContext.java b/java/src/java/com/entrouvert/lasso/LassoProfileContext.java
index fff47500..db32c355 100644
--- a/java/src/java/com/entrouvert/lasso/LassoProfileContext.java
+++ b/java/src/java/com/entrouvert/lasso/LassoProfileContext.java
@@ -25,40 +25,51 @@
package com.entrouvert.lasso;
public abstract class LassoProfileContext extends LassoObject { // LassoProfileContext
-
- protected LassoServer server = null;
- protected LassoUser user = null;
protected LassoNode request = null;
protected LassoNode response = null;
+ protected LassoServer server = null;
+ protected LassoUser user = null;
- public LassoServer getServer(){
- initServerField();
- return server;
- }
+ native protected void initRequestField();
- public LassoUser getUser(){
- initUserField();
- return user;
- }
+ native protected void initResponseField();
+
+ native protected void initServerField();
+
+ native protected void initUserField();
+
+ native public String getMsgBody();
+
+ native public String getMsgRelayState();
+
+ native public String getNameIdentifier();
+
+ native public String getMsgUrl();
+
+ native public String getProviderID();
public LassoNode getRequest(){
initRequestField();
return request;
}
+
+ native public int getRequestType();
+
public LassoNode getResponse(){
initResponseField();
return response;
}
- native public String getProviderID();
+ native public int gettResponseType();
- native public String getMsgUrl();
- native public String getMsgBody();
- native public String getMsgRelayState();
+ public LassoServer getServer(){
+ initServerField();
+ return server;
+ }
- native protected void initServerField();
- native protected void initUserField();
- native protected void initRequestField();
- native protected void initResponseField();
+ public LassoUser getUser(){
+ initUserField();
+ return user;
+ }
} // LassoProfileContext
diff --git a/java/src/java/com/entrouvert/lasso/LassoRequest.java b/java/src/java/com/entrouvert/lasso/LassoRequest.java
index b7be6380..6ea2bb72 100644
--- a/java/src/java/com/entrouvert/lasso/LassoRequest.java
+++ b/java/src/java/com/entrouvert/lasso/LassoRequest.java
@@ -25,6 +25,7 @@
package com.entrouvert.lasso;
public class LassoRequest extends LassoNode { // LassoRequest
+ private LassoRequest() {}
public LassoRequest(String assertionArtifact){
init(assertionArtifact);
diff --git a/java/src/java/com/entrouvert/lasso/LassoServer.java b/java/src/java/com/entrouvert/lasso/LassoServer.java
index 5d723506..dcea192f 100644
--- a/java/src/java/com/entrouvert/lasso/LassoServer.java
+++ b/java/src/java/com/entrouvert/lasso/LassoServer.java
@@ -25,7 +25,6 @@
package com.entrouvert.lasso;
public class LassoServer extends LassoProvider { // LassoServer
-
public LassoServer(String metadataFilePath,
String publicKeyFilePath,
String privateKeyFilePath,
diff --git a/java/tests/LoginTest.java b/java/tests/LoginTest.java
index 8c0c0536..95ebd8b0 100644
--- a/java/tests/LoginTest.java
+++ b/java/tests/LoginTest.java
@@ -96,6 +96,7 @@ public class LoginTest extends TestCase {
spLoginContext = new LassoLogin(spContext, null);
assertEquals(0, spLoginContext.initAuthnRequest(
"https://identity-provider:1998/liberty-alliance/metadata"));
+ assertEquals(Lasso.messageTypeAuthnRequest, spLoginContext.getRequestType());
authnRequest = (LassoAuthnRequest) spLoginContext.getRequest();
authnRequest.setPassive(false);
authnRequest.setNameIdPolicy(Lasso.libNameIdPolicyTypeFederated);
@@ -164,7 +165,7 @@ public class LoginTest extends TestCase {
assertNotNull(spUserContextDump);
spUserContext = new LassoUser(spUserContextDump);
assertNotNull(spUserContext);
- spLogoutContext = new LassoLogout(spContext, spUserContext, Lasso.providerTypeSp);
+ spLogoutContext = new LassoLogout(Lasso.providerTypeSp, spContext, spUserContext);
assertEquals(0, spLogoutContext.initRequest(null));
assertEquals(0, spLogoutContext.buildRequestMsg());
soapEndpoint = spLogoutContext.getMsgUrl();
@@ -177,11 +178,12 @@ public class LoginTest extends TestCase {
assertNotNull(idpContextDump);
idpContext = new LassoServer(idpContextDump);
assertNotNull(idpContext);
- idpLogoutContext = new LassoLogout(idpContext, null, Lasso.providerTypeIdp);
- assertEquals(0, idpLogoutContext.processRequestMsg(soapRequestMsg, Lasso.httpMethodSoap));
+ idpLogoutContext = new LassoLogout(Lasso.providerTypeIdp, idpContext, null);
+ assertEquals(0, idpLogoutContext.loadRequestMsg(soapRequestMsg, Lasso.httpMethodSoap));
assertEquals(nameIdentifier, idpLogoutContext.getNameIdentifier());
assertNotNull(idpUserContextDump);
- assertEquals(0, idpLogoutContext.createUser(idpUserContextDump));
+ assertEquals(0, idpLogoutContext.loadUserDump(idpUserContextDump));
+ assertEquals(0, idpLogoutContext.processRequest());
idpUserContext = idpLogoutContext.getUser();
assertNotNull(idpUserContext);
idpUserContextDump = idpUserContext.dump();
diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py
index 948fd372..137ef2ad 100644
--- a/python/tests/login_tests.py
+++ b/python/tests/login_tests.py
@@ -91,6 +91,7 @@ class LoginTestCase(unittest.TestCase):
spLoginContext = lasso.Login.new(spContext)
self.failUnlessEqual(spLoginContext.init_authn_request(
"https://identity-provider:1998/liberty-alliance/metadata"), 0)
+ self.failUnlessEqual(spLoginContext.request_type, lasso.messageTypeAuthnRequest)
spLoginContext.request.set_isPassive(False)
spLoginContext.request.set_nameIDPolicy(lasso.libNameIDPolicyTypeFederated)
spLoginContext.request.set_consent(lasso.libConsentObtained)