/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final SubjectCanonicalizationContext c14nContext) { if (!embeddedPredicate.apply(profileRequestContext, c14nContext, true)) { return false; } return super.doPreExecute(profileRequestContext, c14nContext); }
/** {@inheritDoc} */ @Override protected void doInitialize() throws ComponentInitializationException { super.doInitialize(); if (attributeSourceIds.isEmpty()) { throw new ComponentInitializationException("Attribute source ID list cannot be empty"); } }
/** {@inheritDoc} */ @Override protected final void doExecute( @Nonnull final ProfileRequestContext<InboundMessageType, OutboundMessageType> profileRequestContext) { doExecute(profileRequestContext, scContext); }
log.debug("{} trimming whitespace of input string '{}'", getLogPrefix(), s); s = s.trim(); log.debug("{} converting input string '{}' to lowercase", getLogPrefix(), s); s = s.toLowerCase(); } else if (uppercase) { log.debug("{} converting input string '{}' to uppercase", getLogPrefix(), s); s = s.toUpperCase(); log.debug("{} applying replacement expression '{}' against input '{}'", getLogPrefix(), p.getFirst().pattern(), s); s = m.replaceAll(p.getSecond()); log.debug("{} result of replacement is '{}'", getLogPrefix(), s);
/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final SubjectCanonicalizationContext c14nContext) { if (!embeddedPredicate.apply(profileRequestContext, c14nContext, true)) { return false; } return super.doPreExecute(profileRequestContext, c14nContext); }
/** {@inheritDoc} */ @Override protected void doInitialize() throws ComponentInitializationException { if (null == decoder) { throw new ComponentInitializationException(getLogPrefix() + " decoder not supplied"); } super.doInitialize(); }
/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final SubjectCanonicalizationContext c14nContext) { if (embeddedPredicate.apply(profileRequestContext, c14nContext, true)) { usernamePrincipal = c14nContext.getSubject().getPrincipals(UsernamePrincipal.class).iterator().next(); return super.doPreExecute(profileRequestContext, c14nContext); } return false; }
/** {@inheritDoc} */ @Override protected void doInitialize() throws ComponentInitializationException { super.doInitialize(); if (null == decoder) { throw new ComponentInitializationException(getLogPrefix() + " decoder not supplied"); } }
/** {@inheritDoc} */ @Override protected boolean doPreExecute( @Nonnull final ProfileRequestContext<InboundMessageType, OutboundMessageType> profileRequestContext) { scContext = scCtxLookupStrategy.apply(profileRequestContext); if (scContext == null) { ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_SUBJECT_C14N_CTX); return false; } return doPreExecute(profileRequestContext, scContext) && super.doPreExecute(profileRequestContext); }
/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final SubjectCanonicalizationContext c14nContext) { attributeCtx = attributeContextLookupStrategy.apply(profileRequestContext); if (attributeCtx == null || attributeCtx.getIdPAttributes().isEmpty()) { log.warn("{} No attributes found, canonicalization not possible", getLogPrefix()); c14nContext.setException(new SubjectCanonicalizationException("No attributes were found")); ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_SUBJECT); return false; } return super.doPreExecute(profileRequestContext, c14nContext); }
/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final SubjectCanonicalizationContext c14nContext) { final Set<X509Certificate> certificates = c14nContext.getSubject().getPublicCredentials(X509Certificate.class); if (certificates != null && certificates.size() == 1) { certificate = certificates.iterator().next(); x500Principal = certificate.getSubjectX500Principal(); } else { final Set<X500Principal> principals = c14nContext.getSubject().getPrincipals(X500Principal.class); if (principals != null && principals.size() == 1) { x500Principal = principals.iterator().next(); } } if (x500Principal != null) { return super.doPreExecute(profileRequestContext, c14nContext); } c14nContext.setException(new SubjectCanonicalizationException( "Neither a single X509Certificate nor X500Principal were found")); ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_SUBJECT); return false; }
/** {@inheritDoc} */ @Override protected boolean doPreExecute(@Nonnull final ProfileRequestContext profileRequestContext, @Nonnull final SubjectCanonicalizationContext c14nContext) { // Detect a previous attempted flow, and move it to the intermediate collection. // This will prevent re-selecting the same (probably failed) flow again. if (c14nContext.getAttemptedFlow() != null) { log.info("{} Moving incomplete flow {} to intermediate set, reselecting a different one", getLogPrefix(), c14nContext.getAttemptedFlow().getId()); c14nContext.getIntermediateFlows().put( c14nContext.getAttemptedFlow().getId(), c14nContext.getAttemptedFlow()); } return super.doPreExecute(profileRequestContext, c14nContext); }