• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AuthenticationContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AuthenticationContext类属于net.shibboleth.idp.authn.context包,在下文中一共展示了AuthenticationContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: extAuthnHandlerSetsErrorAttributeWhenIdentificationFails

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@Test
public void extAuthnHandlerSetsErrorAttributeWhenIdentificationFails() throws Exception {
    when(mockAuthenticationHandlerService.buildSession(any()))
            .thenReturn(null);
    when(mockAuthenticationHandlerService.purgeSession(any()))
            .thenReturn(mock(MultivaluedMap.class));
    ProfileRequestContext profileRequestContext = new ProfileRequestContext();
    profileRequestContext.addSubcontext(new AuthenticationContext());

    MockHttpServletRequest request = getQueryParamRequest(getValidTupasResponseParams());
    MockHttpServletResponse response = new MockHttpServletResponse();

    when(ExternalAuthentication.getProfileRequestContext("e1s1", request)).thenReturn(profileRequestContext);

    extAuthnHandler.doGet(request, response);

    AuthenticationContext authenticationContext = profileRequestContext.getSubcontext(AuthenticationContext.class);
    assertNotNull(authenticationContext);
    TupasContext tupasContext = authenticationContext.getSubcontext(TupasContext.class);
    assertNull(tupasContext);
    assertNotNull(response.getRedirectedUrl());
}
 
开发者ID:vrk-kpa,项目名称:e-identification-tupas-idp-public,代码行数:23,代码来源:ShibbolethExtAuthnHandlerTest.java


示例2: doExecute

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {

    log.debug("{} Initializing authentication context", getLogPrefix());
    final AuthenticationContext authnCtx = new AuthenticationContext();
    if (getAuthenticationRequest().getPrompt() != null) {
        authnCtx.setIsPassive(getAuthenticationRequest().getPrompt().contains(Prompt.Type.NONE));
        authnCtx.setForceAuthn(getAuthenticationRequest().getPrompt().contains(Prompt.Type.LOGIN));
    }
    if (getAuthenticationRequest().getLoginHint() != null) {
        authnCtx.setHintedName(getAuthenticationRequest().getLoginHint());
    }
    final AuthenticationContext initialAuthnContext =
            profileRequestContext.getSubcontext(AuthenticationContext.class);
    if (initialAuthnContext != null) {
        authnCtx.setInitialAuthenticationResult(initialAuthnContext.getAuthenticationResult());
    }
    
    profileRequestContext.addSubcontext(authnCtx, true);
    log.debug("{} Created authentication context: {}", getLogPrefix(), authnCtx);
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:23,代码来源:InitializeAuthenticationContext.java


示例3: getUnattemptedInactiveFlow

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/**
 * Return the first inactive potential flow not found in the intermediate
 * flows collection that applies to the request.
 * 
 * @param profileRequestContext
 *            the current profile request context
 * @param authenticationContext
 *            the current authentication context
 * @return an eligible flow, or null
 */
@Nullable
private AuthenticationFlowDescriptor getUnattemptedInactiveFlow(
        @Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final AuthenticationContext authenticationContext) {
    for (final AuthenticationFlowDescriptor flow : authenticationContext.getPotentialFlows().values()) {
        if (!authenticationContext.getIntermediateFlows().containsKey(flow.getId())) {
            if (!authenticationContext.isPassive() || flow.isPassiveAuthenticationSupported()) {
                if (flow.apply(profileRequestContext)) {
                    return flow;
                }
            }
        }
    }

    return null;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:27,代码来源:SelectAuthenticationFlow.java


示例4: doSelectRequestedPrincipals

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/**
 * Executes the selection process in the presence of specific requested
 * Principals, requiring evaluation of potential flows and results for
 * Principal-compatibility with request.
 * 
 * @param profileRequestContext
 *            the current IdP profile request context
 * @param authenticationContext
 *            the current authentication context
 */
private boolean doSelectRequestedPrincipals(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final AuthenticationContext authenticationContext) {

    log.debug("{} Specific principals requested with '{}' operator: {}", getLogPrefix(),
            requestedPrincipalCtx.getOperator(), requestedPrincipalCtx.getRequestedPrincipals());

    if (authenticationContext.getInitialAuthenticationResult() != null
            && authenticationContext.getPotentialFlows().containsKey(
                    authenticationContext.getInitialAuthenticationResult().getAuthenticationFlowId())) {
        // Invoke possible SSO but with the initial result as the only
        // possible reuse option.
        return selectRequestedFlow(profileRequestContext, authenticationContext, Collections.singletonMap(
                authenticationContext.getInitialAuthenticationResult().getAuthenticationFlowId(),
                authenticationContext.getInitialAuthenticationResult()));
    } else if (authenticationContext.isForceAuthn()) {
        log.debug("{} Forced authentication requested, selecting an inactive flow", getLogPrefix());
        return selectRequestedInactiveFlow(profileRequestContext, authenticationContext);
    } else if (authenticationContext.getActiveResults().isEmpty()) {
        log.debug("{} No active results available, selecting an inactive flow", getLogPrefix());
        return selectRequestedInactiveFlow(profileRequestContext, authenticationContext);
    } else {
        return selectRequestedFlow(profileRequestContext, authenticationContext,
                authenticationContext.getActiveResults());
    }
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:36,代码来源:SelectAuthenticationFlow.java


示例5: testOIDCAuthnRequestNoFlags

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/**
 * Test that the action functions properly if the inbound message is a oidc
 * authentication request.
 */
@Test
public void testOIDCAuthnRequestNoFlags() throws Exception {
    AuthenticationRequest req = AuthenticationRequest
            .parse("response_type=code&client_id=s6BhdRkqt3&login_hint=foo&redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb&scope=openid%20profile&state=af0ifjsldkj&nonce=n-0S6_WzA2Mj");
    final RequestContext requestCtx = new RequestContextBuilder().setInboundMessage(req).buildRequestContext();
    @SuppressWarnings("rawtypes")
    final ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(requestCtx);
    final InitializeAuthenticationContext action = new InitializeAuthenticationContext();
    action.initialize();
    final Event event = action.execute(requestCtx);
    ActionTestingSupport.assertProceedEvent(event);
    AuthenticationContext authnCtx = prc.getSubcontext(AuthenticationContext.class);
    Assert.assertFalse(authnCtx.isForceAuthn());
    Assert.assertFalse(authnCtx.isPassive());
    Assert.assertEquals(authnCtx.getHintedName(), "foo");

}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:InitializeAuthenticationContextTest.java


示例6: init

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private void init(String request) throws ParseException, ComponentInitializationException {
    AuthenticationRequest req = AuthenticationRequest.parse(request);
    requestCtx = new RequestContextBuilder().setInboundMessage(req).buildRequestContext();
    ProfileRequestContext prc = new WebflowRequestContextProfileRequestContextLookup().apply(requestCtx);
    authnCtx = prc.getSubcontext(AuthenticationContext.class, true);
    List<AuthenticationResult> results = new ArrayList<AuthenticationResult>();
    Subject subject1 = new Subject();
    AuthenticationResult result1 = new AuthenticationResult("id1", subject1);
    // 10 seconds ago
    result1.setAuthenticationInstant(new Date().getTime() - 10000);
    Subject subject2 = new Subject();
    AuthenticationResult result2 = new AuthenticationResult("id2", subject2);
    // 5 seconds ago
    result2.setAuthenticationInstant(new Date().getTime() - 5000);
    results.add(result1);
    results.add(result2);
    authnCtx.setActiveResults(results);
    action = new FilterActiveAuthenticationResultsByMaxAge();
    action.initialize();
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:FilterActiveAuthenticationResultsByMaxAgeTest.java


示例7: testRequestNoneActive

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@Test
public void testRequestNoneActive() {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    final List<Principal> principals = Arrays.<Principal> asList(new TestPrincipal("test3"));
    final RequestedPrincipalContext rpc = new RequestedPrincipalContext();
    rpc.getPrincipalEvalPredicateFactoryRegistry().register(TestPrincipal.class, "exact",
            new ExactPrincipalEvalPredicateFactory());
    rpc.setOperator("exact");
    rpc.setRequestedPrincipals(principals);
    authCtx.addSubcontext(rpc, true);
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(principals);

    action.execute(src);

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


示例8: testRequestNoneActiveIntermediate

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@Test
public void testRequestNoneActiveIntermediate() {
    final AuthenticationContext authCtx = prc.getSubcontext(AuthenticationContext.class);
    authCtx.getIntermediateFlows().put("test2", authCtx.getPotentialFlows().get("test2"));
    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);
    authCtx.getPotentialFlows().get("test2").setSupportedPrincipals(principals);
    authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(principals);

    action.execute(src);

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


示例9: 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


示例10: 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


示例11: 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


示例12: 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


示例13: 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


示例14: apply

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@Nullable
public Long apply(@Nullable final ProfileRequestContext input) {
    if (input == null) {
        return null;
    }
    AuthenticationContext authCtx = input.getSubcontext(AuthenticationContext.class, false);
    if (authCtx == null) {
        return null;
    }
    AuthenticationResult authResult = authCtx.getAuthenticationResult();
    if (authResult == null) {
        return null;
    }
    return authResult.getAuthenticationInstant();

}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:19,代码来源:DefaultAuthTimeLookupFunction.java


示例15: ShibbolethExtAuthnHandlerBuildsSessionOnPost

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@Test
public void ShibbolethExtAuthnHandlerBuildsSessionOnPost() throws Exception {
    when(mockAuthenticationHandlerService.buildSession(any()))
            .thenReturn(new TupasIdentification("210281-9988", "TESTAA PORTAALIA", "e1s1"));
    ProfileRequestContext profileRequestContext = new ProfileRequestContext();
    profileRequestContext.addSubcontext(new AuthenticationContext());

    MockHttpServletRequest request = getQueryParamRequest(getValidTupasResponseParams());
    request.setParameter("token", "NOT_NULL_ILLOGICAL_MOCK");
    MockHttpServletResponse response = new MockHttpServletResponse();

    when(ExternalAuthentication.getProfileRequestContext("e1s1", request)).thenReturn(profileRequestContext);

    extAuthnHandler.doPost(request, response);

    AuthenticationContext authenticationContext = profileRequestContext.getSubcontext(AuthenticationContext.class);
    assertNotNull(authenticationContext);
    TupasContext tupasContext = authenticationContext.getSubcontext(TupasContext.class);
    assertNotNull(tupasContext);
    assertEquals("TESTAA PORTAALIA", tupasContext.getCn());
    assertEquals("210281-9988", tupasContext.getHetu());
}
 
开发者ID:vrk-kpa,项目名称:e-identification-tupas-idp-public,代码行数:23,代码来源:ShibbolethExtAuthnHandlerTest.java


示例16: doPreExecute

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@Override
  protected boolean doPreExecute(
          @Nonnull ProfileRequestContext profileRequestContext,
          @Nonnull AuthenticationContext authenticationContext) {
      if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
          return false;
      }

username = usernameLookupStrategy.apply(profileRequestContext);

      if (username == null) {
      	logger.warn("{} No previous SubjectContext or Principal is set", getLogPrefix());
      	handleError(profileRequestContext, authenticationContext, "NoCredentials", AuthnEventIds.NO_CREDENTIALS);
      	return false;
      }
      
  	logger.debug("{} PrincipalName from SubjectContext is {}", getLogPrefix(), username);
      return true;
  }
 
开发者ID:cyber-simon,项目名称:idp-auth-linotp,代码行数:20,代码来源:TokenValidator.java


示例17: doExecute

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
@Override
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) {
    this.usernamePasswordContext = authenticationContext.getSubcontext(UsernamePasswordContext.class);
    if (usernamePasswordContext == null) {
        logger.info(getLogPrefix() + "No UsernamePasswordContext available within authentication context");
        handleError(profileRequestContext, authenticationContext, "NoCredentials", AuthnEventIds.NO_CREDENTIALS);
    } else if (usernamePasswordContext.getUsername() == null || usernamePasswordContext.getUsername().equals("")) {
        logger.info(getLogPrefix() + "No username available within UsernamePasswordContext");
        handleError(profileRequestContext, authenticationContext, "NoCredentials", AuthnEventIds.NO_CREDENTIALS);
    } else if (usernamePasswordContext.getPassword() == null || usernamePasswordContext.getPassword().equals("")) {
        logger.info(getLogPrefix() + "No password available witin UsernamePasswordContext");
        handleError(profileRequestContext, authenticationContext, "InvalidCredentials", AuthnEventIds.INVALID_CREDENTIALS);
    } else if (!usernamePasswordContext.getUsername().equals(usernamePasswordContext.getPassword())) {
        logger.info(getLogPrefix() + "Login by " + usernamePasswordContext.getUsername() + " failed");
        handleError(profileRequestContext, authenticationContext, "InvalidCredentials", AuthnEventIds.INVALID_CREDENTIALS);
    } else {
        logger.info(getLogPrefix() + "Login by " + usernamePasswordContext.getUsername() + " succeeded");
        buildAuthenticationResult(profileRequestContext, authenticationContext);
    }
}
 
开发者ID:UniconLabs,项目名称:shibboleth-hazelcast-storage-service,代码行数:21,代码来源:ValidateUsernamePasswordAgainstMagic.java


示例18: doPreExecute

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext) {

    AuthenticationContext authCtx = profileRequestContext.getSubcontext(AuthenticationContext.class, false);
    if (authCtx == null) {
        log.error("{} No authentication context", getLogPrefix());
        ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
        return false;
    }
    requestedPrincipalContext = authCtx.getSubcontext(RequestedPrincipalContext.class);
    return super.doPreExecute(profileRequestContext);
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:14,代码来源:SetAuthenticationContextClassReferenceToResponseContext.java


示例19: doPreExecute

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
    if (!super.doPreExecute(profileRequestContext)) {
        log.error("{} pre-execute failed", getLogPrefix());
        return false;
    }
    acrValues = getAuthenticationRequest().getACRValues();
    if (getAuthenticationRequest().getClaims() != null
            && getAuthenticationRequest().getClaims().getIDTokenClaims() != null) {
        for (Entry entry : getAuthenticationRequest().getClaims().getIDTokenClaims()) {
            if (IDTokenClaimsSet.ACR_CLAIM_NAME.equals(entry.getClaimName())) {
                acrClaim = entry;
                break;
            }
        }
    }
    if ((acrValues == null || acrValues.isEmpty())
            && (acrClaim == null || (acrClaim.getValues() == null && acrClaim.getValue() == null))) {
        log.debug("No acr values nor acr claim values in request, nothing to do");
        return false;
    }
    authenticationContext = profileRequestContext.getSubcontext(AuthenticationContext.class, false);
    if (authenticationContext == null) {
        log.error("{} No authentication context", getLogPrefix());
        ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_PROFILE_CTX);
        return false;
    }
    return true;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:31,代码来源:ProcessRequestedAuthnContext.java


示例20: doPreExecute

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入依赖的package包/类
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final AuthenticationContext authenticationContext) {

    if (!super.doPreExecute(profileRequestContext, authenticationContext)) {
        return false;
    }

    requestedPrincipalCtx = authenticationContext.getSubcontext(RequestedPrincipalContext.class);
    if (requestedPrincipalCtx != null) {
        if (requestedPrincipalCtx.getOperator() == null || requestedPrincipalCtx.getRequestedPrincipals().isEmpty()) {
            requestedPrincipalCtx = null;
        }
    }

    // Detect a previous attempted flow, and move it to the intermediate
    // collection.
    // This will prevent re-selecting the same (probably failed) flow again
    // as part of
    // general flow selection. A flow might signal to explicitly re-run
    // another flow anyway.
    if (authenticationContext.getAttemptedFlow() != null) {
        log.info("{} Moving incomplete flow {} to intermediate set", getLogPrefix(), authenticationContext
                .getAttemptedFlow().getId());
        authenticationContext.getIntermediateFlows().put(authenticationContext.getAttemptedFlow().getId(),
                authenticationContext.getAttemptedFlow());
    }

    return true;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:33,代码来源:SelectAuthenticationFlow.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PKCS7Padding类代码示例发布时间:2022-05-22
下一篇:
Java PrepareBulkLoadRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap