[java-idp-plugin-duo] branch main updated: Add external auth context as a subcontext in flow tests

Phil Smart philip.smart at jisc.ac.uk
Thu Mar 11 12:17:23 UTC 2021


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch main
in repository java-idp-plugin-duo.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=eda26594eece494e8e90bdd628094af64f132469

The following commit(s) were added to refs/heads/main by this push:
       new  eda2659   Add external auth context as a subcontext in flow tests
eda2659 is described below

commit eda26594eece494e8e90bdd628094af64f132469
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Thu Mar 11 12:17:20 2021 +0000

    Add external auth context as a subcontext in flow tests
---
 .../shibboleth/idp/plugin/authn/duo/impl/DuoAuthnFlowTest.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthnFlowTest.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthnFlowTest.java
index e3e30df..994ae22 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthnFlowTest.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/duo/impl/DuoAuthnFlowTest.java
@@ -37,8 +37,10 @@ import org.springframework.webflow.execution.FlowExecution;
 import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
+import net.shibboleth.idp.authn.context.ExternalAuthenticationContext;
 import net.shibboleth.idp.authn.context.RequestedPrincipalContext;
 import net.shibboleth.idp.authn.context.SubjectCanonicalizationContext;
+import net.shibboleth.idp.authn.impl.ExternalAuthenticationImpl;
 import net.shibboleth.idp.plugin.authn.duo.DefaultDuoOIDCIntegration;
 import net.shibboleth.idp.plugin.authn.duo.DuoClientException;
 import net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext;
@@ -327,10 +329,14 @@ public class DuoAuthnFlowTest extends AbstractAuthnXmlFlowExecutionTests {
         
         duoContext.setIntegration(integ);
         
+        
+        
         //add the mock client as was not added by the populate stage
         duoContext.setClient(new MockDuoOIDCClient_OK(duoContext.getIntegration()));
         
         prc.getSubcontext(AuthenticationContext.class).addSubcontext(duoContext);
+        prc.getSubcontext(AuthenticationContext.class)
+                    .addSubcontext(new ExternalAuthenticationContext(new ExternalAuthenticationImpl(false)));
         flowExecution.getConversationScope().put("opensamlProfileRequestContext",prc);
         updateFlowExecution(flowExecution);
         
@@ -403,6 +409,8 @@ public class DuoAuthnFlowTest extends AbstractAuthnXmlFlowExecutionTests {
         duoContext.setClient(new MockDuoOIDCClient_OK(duoContext.getIntegration()));
         
         prc.getSubcontext(AuthenticationContext.class).addSubcontext(duoContext);
+        prc.getSubcontext(AuthenticationContext.class)
+                    .addSubcontext(new ExternalAuthenticationContext(new ExternalAuthenticationImpl(false)));
         
         //add a requested principal context.
         final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
@@ -492,6 +500,8 @@ public class DuoAuthnFlowTest extends AbstractAuthnXmlFlowExecutionTests {
         duoContext.setClient(new MockDuoOIDCClient_OK_OLD_AUTH_TIME(duoContext.getIntegration()));
         
         prc.getSubcontext(AuthenticationContext.class).addSubcontext(duoContext);
+        prc.getSubcontext(AuthenticationContext.class)
+                    .addSubcontext(new ExternalAuthenticationContext(new ExternalAuthenticationImpl(false)));
         flowExecution.getConversationScope().put("opensamlProfileRequestContext",prc);
         updateFlowExecution(flowExecution);
         

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list