当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationContext.setActiveResults方法代码示例

本文整理汇总了Java中net.shibboleth.idp.authn.context.AuthenticationContext.setActiveResults方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationContext.setActiveResults方法的具体用法?Java AuthenticationContext.setActiveResults怎么用?Java AuthenticationContext.setActiveResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.shibboleth.idp.authn.context.AuthenticationContext的用法示例。


在下文中一共展示了AuthenticationContext.setActiveResults方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRequestPickInactive

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testRequestPickInactive() {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    final List<Principal> principals = Arrays.<Principal> asList(new TestPrincipal("test3"), new TestPrincipal(
            "test2"));
    final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
    rpc.getPrincipalEvalPredicateFactoryRegistry().register(TestPrincipal.class, "exact",
            new ExactPrincipalEvalPredicateFactory());
    rpc.setOperator("exact");
    rpc.setRequestedPrincipals(principals);
    authCtx.addSubcontext(rpc, true);
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    active.getSubject().getPrincipals().add(new TestPrincipal("test2"));
    authCtx.setActiveResults(Arrays.asList(active));
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));

    action.execute(src);

    Assert.assertNull(authCtx.getAuthenticationResult());
    Assert.assertEquals(authCtx.getAttemptedFlow(), authCtx.getPotentialFlows().get("test3"));
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:SelectAuthenticationFlowTest.java

示例2: testRequestPickInactiveInitial

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testRequestPickInactiveInitial() {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    final List<Principal> principals = Arrays.<Principal> asList(new TestPrincipal("test3"), new TestPrincipal(
            "test2"));
    final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
    rpc.getPrincipalEvalPredicateFactoryRegistry().register(TestPrincipal.class, "exact",
            new ExactPrincipalEvalPredicateFactory());
    rpc.setOperator("exact");
    rpc.setRequestedPrincipals(principals);
    authCtx.addSubcontext(rpc, true);
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    active.getSubject().getPrincipals().add(new TestPrincipal("test2"));
    authCtx.setActiveResults(Arrays.asList(active));
    authCtx.setInitialAuthenticationResult(active);
    authCtx.setForceAuthn(true);
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));

    action.execute(src);

    Assert.assertNull(authCtx.getAuthenticationResult());
    Assert.assertEquals(authCtx.getAttemptedFlow(), authCtx.getPotentialFlows().get("test3"));
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:24,代码来源:SelectAuthenticationFlowTest.java

示例3: testRequestPickActiveInitial

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testRequestPickActiveInitial() throws ComponentInitializationException {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    final List<Principal> principals = Arrays.<Principal> asList(new TestPrincipal("test3"), new TestPrincipal(
            "test2"));
    final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
    rpc.getPrincipalEvalPredicateFactoryRegistry().register(TestPrincipal.class, "exact",
            new ExactPrincipalEvalPredicateFactory());
    rpc.setOperator("exact");
    rpc.setRequestedPrincipals(principals);
    authCtx.addSubcontext(rpc, true);
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    active.getSubject().getPrincipals().add(new TestPrincipal("test2"));
    authCtx.setActiveResults(Arrays.asList(active));
    authCtx.setInitialAuthenticationResult(active);
    authCtx.setForceAuthn(true);
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));

    action = new SelectAuthenticationFlow();
    action.setFavorSSO(true);
    action.initialize();
    action.execute(src);

    Assert.assertEquals(active, authCtx.getAuthenticationResult());
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:26,代码来源:SelectAuthenticationFlowTest.java

示例4: testRequestPickActive

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testRequestPickActive() {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    final List<Principal> principals = Arrays.<Principal> asList(new TestPrincipal("test3"), new TestPrincipal(
            "test2"));
    final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
    rpc.getPrincipalEvalPredicateFactoryRegistry().register(TestPrincipal.class, "exact",
            new ExactPrincipalEvalPredicateFactory());
    rpc.setOperator("exact");
    rpc.setRequestedPrincipals(principals);
    authCtx.addSubcontext(rpc, true);
    final AuthenticationResult active = new AuthenticationResult("test3", new Subject());
    active.getSubject().getPrincipals().add(new TestPrincipal("test3"));
    authCtx.setActiveResults(Arrays.asList(active));
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));

    final Event event = action.execute(src);

    ActionTestingSupport.assertProceedEvent(event);
    Assert.assertEquals(active, authCtx.getAuthenticationResult());
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:SelectAuthenticationFlowTest.java

示例5: testRequestFavorSSO

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testRequestFavorSSO() throws ComponentInitializationException {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    final List<Principal> principals = Arrays.<Principal> asList(new TestPrincipal("test3"), new TestPrincipal(
            "test2"));
    final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
    rpc.getPrincipalEvalPredicateFactoryRegistry().register(TestPrincipal.class, "exact",
            new ExactPrincipalEvalPredicateFactory());
    rpc.setOperator("exact");
    rpc.setRequestedPrincipals(principals);
    authCtx.addSubcontext(rpc, true);
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    active.getSubject().getPrincipals().add(new TestPrincipal("test2"));
    authCtx.setActiveResults(Arrays.asList(active));
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));

    action = new SelectAuthenticationFlow();
    action.setFavorSSO(true);
    action.initialize();
    final Event event = action.execute(src);

    ActionTestingSupport.assertProceedEvent(event);
    Assert.assertEquals(active, authCtx.getAuthenticationResult());
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:25,代码来源:SelectAuthenticationFlowTest.java

示例6: testNoRequestActive

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testNoRequestActive() {
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    authCtx.setActiveResults(Arrays.asList(active));

    final Event event = action.execute(src);

    ActionTestingSupport.assertProceedEvent(event);
    Assert.assertEquals(active, authCtx.getAuthenticationResult());
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:12,代码来源:SelectAuthenticationFlowTest.java

示例7: testNoRequestInitialForced

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testNoRequestInitialForced() {
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    authCtx.setForceAuthn(true);
    authCtx.setInitialAuthenticationResult(active);
    authCtx.setActiveResults(Arrays.asList(active));

    final Event event = action.execute(src);

    ActionTestingSupport.assertProceedEvent(event);
    Assert.assertEquals(active, authCtx.getAuthenticationResult());
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:14,代码来源:SelectAuthenticationFlowTest.java

示例8: testNoRequestForced

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
@Test
public void testNoRequestForced() {
    final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    authCtx.setActiveResults(Arrays.asList(active));
    authCtx.setForceAuthn(true);

    final Event event = action.execute(src);

    Assert.assertNull(authCtx.getAuthenticationResult());
    Assert.assertEquals(authCtx.getAttemptedFlow(), authCtx.getPotentialFlows().get(event.getId()));
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:13,代码来源:SelectAuthenticationFlowTest.java


注:本文中的net.shibboleth.idp.authn.context.AuthenticationContext.setActiveResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。