/** * Set supported non-user-specific principals that the action will include in the subjects * it generates, in place of any default principals from the flow. * * <p>Setting to a null or empty collection will maintain the default behavior of relying on the flow.</p> * * @param <T> a type of principal to add, if not generic * @param principals supported principals to include */ public <T extends Principal> void setSupportedPrincipals( @Nullable @NonnullElements final Collection<T> principals) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); getSubject().getPrincipals().clear(); if (principals != null && !principals.isEmpty()) { getSubject().getPrincipals().addAll(Collections2.filter(principals, Predicates.notNull())); } }
/** {@inheritDoc} */ @Override @Nonnull @NonnullElements @Unmodifiable @NotLive public <T extends Principal> Set<T> getSupportedPrincipals( @Nonnull final Class<T> c) { return getSubject().getPrincipals(c); }
getSubject().getPrincipals().addAll( authenticationContext.getAttemptedFlow().getSupportedPrincipals()); populateSubject(getSubject())); authenticationContext.setAuthenticationResult(result);
if (rpCtx != null && rpCtx.getOperator() != null && !getSubject().getPrincipals().isEmpty()) { log.debug("{} Request contains principal requirements, evaluating for compatibility", getLogPrefix()); for (final Principal p : rpCtx.getRequestedPrincipals()) {