[java-identity-provider COMMIT] in /trunk/idp-conf/src: main/resources/system/flows/cas/login/login-flow.xml test/jav...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Mar 2 12:55:40 EST 2016
Author: serac
Date: Wed Mar 2 12:55:39 2016
New Revision: 8119
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8119&view=rev
Log:
IDP-918 Grant ST in gateway mode if IdP session exists.
Modified:
trunk/idp-conf/src/main/resources/system/flows/cas/login/login-flow.xml
trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java
Modified: trunk/idp-conf/src/main/resources/system/flows/cas/login/login-flow.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/flows/cas/login/login-flow.xml?rev=8119&r1=8118&r2=8119&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/flows/cas/login/login-flow.xml (original)
+++ trunk/idp-conf/src/main/resources/system/flows/cas/login/login-flow.xml Wed Mar 2 12:55:39 2016
@@ -36,8 +36,14 @@
<decision-state id="CheckAuthenticationRequired">
<if test="flowScope.serviceTicketRequest.gateway"
+ then="CheckForExistingSession"
+ else="CheckInitialAuthenticationRequired" />
+ </decision-state>
+
+ <decision-state id="CheckForExistingSession">
+ <if test="SessionPrincipalLookupFunction.apply(opensamlProfileRequestContext) == null"
then="PrepareForRedirectToService"
- else="CheckInitialAuthenticationRequired" />
+ else="CheckResolveAttributes" />
</decision-state>
<action-state id="PrepareForRedirectToService">
Modified: trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java?rev=8119&r1=8118&r2=8119&view=diff
==============================================================================
--- trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java (original)
+++ trunk/idp-conf/src/test/java/net/shibboleth/idp/test/flows/cas/LoginFlowTest.java Wed Mar 2 12:55:39 2016
@@ -83,7 +83,7 @@
@Test
- public void testGateway() throws Exception {
+ public void testGatewayNoSession() throws Exception {
final String service = "https://gateway.example.org/";
externalContext.getMockRequestParameterMap().put("service", service);
externalContext.getMockRequestParameterMap().put("gateway", "true");
@@ -92,6 +92,23 @@
assertEquals(result.getOutcome().getId(), "RedirectToService");
assertEquals(externalContext.getExternalRedirectUrl(), service);
+ }
+
+ @Test
+ public void testGatewayWithSession() throws Exception {
+ final String service = "https://gateway.example.org/";
+ final IdPSession existing = sessionManager.createSession("aurora");
+ existing.addAuthenticationResult(new AuthenticationResult("authn/Password", new UsernamePrincipal("aurora")));
+ externalContext.getMockRequestParameterMap().put("service", service);
+ overrideEndStateOutput(FLOW_ID, "RedirectToService");
+ request.setCookies(new Cookie("shib_idp_session", existing.getId()));
+ initializeThreadLocals();
+
+ final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
+ final FlowExecutionOutcome outcome = result.getOutcome();
+ assertEquals(outcome.getId(), "RedirectToService");
+ final String url = externalContext.getExternalRedirectUrl();
+ assertTrue(url.contains(service + "?ticket=ST-"));
}
@Test
More information about the commits
mailing list