diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-07-22 08:37:09 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-07-22 08:37:09 +0000 |
| commit | c2dc90e2e99a83a1d80042c0405ecba94ad01845 (patch) | |
| tree | 329fb42f4f50fedf6c52d98d4fc1a5cd840c507c /java/tests | |
| parent | 255f09ed98f1e554093dce03c384bf5c4dbea091 (diff) | |
| download | lasso-c2dc90e2e99a83a1d80042c0405ecba94ad01845.tar.gz lasso-c2dc90e2e99a83a1d80042c0405ecba94ad01845.tar.xz lasso-c2dc90e2e99a83a1d80042c0405ecba94ad01845.zip | |
Java & Python tests do not regress. They even progress.
Diffstat (limited to 'java/tests')
| -rw-r--r-- | java/tests/LoginTest.java | 14 |
1 files changed, 13 insertions, 1 deletions
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() { |
