@Test public void testBuildAuthnRequestObject() throws Exception { String consumerUrl = "http://someurl.com"; String idpUrl = "http://idp.domain.example"; String spId = "cloudstack"; String authnId = SAMLUtils.generateSecureRandomId(); AuthnRequest req = SAMLUtils.buildAuthnRequestObject(authnId, spId, idpUrl, consumerUrl); assertEquals(req.getAssertionConsumerServiceURL(), consumerUrl); assertEquals(req.getDestination(), idpUrl); assertEquals(req.getIssuer().getValue(), spId); }
@Test public void testGenerateSecureRandomId() throws Exception { assertTrue(SAMLUtils.generateSecureRandomId().length() > 0); }