From c2dc90e2e99a83a1d80042c0405ecba94ad01845 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Thu, 22 Jul 2004 08:37:09 +0000 Subject: Java & Python tests do not regress. They even progress. --- java/tests/LoginTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'java/tests/LoginTest.java') diff --git a/java/tests/LoginTest.java b/java/tests/LoginTest.java index d4455f34..018e8545 100644 --- a/java/tests/LoginTest.java +++ b/java/tests/LoginTest.java @@ -77,6 +77,7 @@ public class LoginTest extends TestCase { } public void test02_serviceProviderLogin() { + // Service provider login using HTTP redirect. String spContextDump = generateServiceProviderContextDump(); assertNotNull(spContextDump); LassoServer spContext = new LassoServer(spContextDump); @@ -86,9 +87,20 @@ public class LoginTest extends TestCase { LassoAuthnRequest authnRequest = (LassoAuthnRequest) spLoginContext.getRequest(); authnRequest.setPassive(false); authnRequest.setNameIdPolicy(Lasso.libNameIdPolicyTypeFederated); - // FIXME authnRequest.setConsent(Lasso.libConsentObtained); + authnRequest.setConsent(Lasso.libConsentObtained); authnRequest.setRelayState("fake"); assertEquals(spLoginContext.buildAuthnRequestMsg(), 0); + String authnRequestUrl = spLoginContext.getMsgUrl(); + String authnRequestMsg = authnRequestUrl.substring(authnRequestUrl.indexOf("?") + 1); + int method = Lasso.httpMethodRedirect; + + // Identity provider singleSignOn, for a user having no federation. + String idpContextDump = generateIdentityProviderContextDump(); + assertNotNull(idpContextDump); + LassoServer idpContext = new LassoServer(idpContextDump); + LassoLogin idpLoginContext = new LassoLogin(idpContext, null); + assertEquals(idpLoginContext.initFromAuthnRequestMsg(authnRequestMsg, method), 0); + assertTrue(idpLoginContext.mustAuthenticate()); } public static Test suite() { -- cgit