[java-identity-provider COMMIT] in /trunk: idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDes...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Feb 1 10:04:56 EST 2017
Author: scantor
Date: Wed Feb 1 10:04:55 2017
New Revision: 8608
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8608&view=rev
Log:
IDP-1114 - Better control over AuthenticationResult reuse
https://issues.shibboleth.net/jira/browse/IDP-1114
Modified:
trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java
trunk/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
Modified: trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java?rev=8608&r1=8607&r2=8608&view=diff
==============================================================================
--- trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java (original)
+++ trunk/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationFlowDescriptor.java Wed Feb 1 10:04:55 2017
@@ -72,6 +72,9 @@
/** Whether this flow supports forced authentication. */
private boolean supportsForced;
+
+ /** Whether this flow allows reuse of its results. */
+ @Nonnull private Predicate<ProfileRequestContext> reuseCondition;
/** Maximum amount of time in milliseconds, since first usage, a flow should be considered active. */
@Duration @NonNegative private long lifetime;
@@ -94,6 +97,7 @@
/** Constructor. */
public AuthenticationFlowDescriptor() {
supportsNonBrowser = true;
+ reuseCondition = Predicates.alwaysTrue();
supportedPrincipals = new Subject();
activationCondition = Predicates.alwaysTrue();
inactivityTimeout = 30 * 60 * 1000;
@@ -157,6 +161,32 @@
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
supportsForced = isSupported;
+ }
+
+ /**
+ * Get condition controlling whether results from this flow should be reused for SSO.
+ *
+ * @return whether results from this flow should be reused for SSO
+ *
+ * @since 3.4.0
+ */
+ @Nonnull public Predicate<ProfileRequestContext> getReuseCondition() {
+ return reuseCondition;
+ }
+
+ /**
+ * Set condition controlling whether results from this flow should be reused for SSO.
+ *
+ * <p>Defaults to {@link Predicates#alwaysTrue()}.</p>
+ *
+ * @param condition condition to set
+ *
+ * @since 3.4.0
+ */
+ public void setReuseCondition(@Nonnull final Predicate<ProfileRequestContext> condition) {
+ ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
+
+ reuseCondition = Constraint.isNotNull(condition, "Predicate cannot be null");
}
/**
@@ -340,8 +370,8 @@
/** {@inheritDoc} */
@Override public String toString() {
return MoreObjects.toStringHelper(this).add("flowId", getId()).add("supportsPassive", supportsPassive)
- .add("supportsForcedAuthentication", supportsForced).add("lifetime", lifetime)
- .add("inactivityTimeout", inactivityTimeout).toString();
+ .add("supportsForcedAuthentication", supportsForced)
+ .add("lifetime", lifetime).add("inactivityTimeout", inactivityTimeout).toString();
}
static {
Modified: trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java?rev=8608&r1=8607&r2=8608&view=diff
==============================================================================
--- trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java (original)
+++ trunk/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlow.java Wed Feb 1 10:04:55 2017
@@ -86,18 +86,18 @@
@Nullable private RequestedPrincipalContext requestedPrincipalCtx;
/**
- * Get whether SSO should trump explicit relying party flow preference.
- *
- * @return whether SSO should trump explicit relying party flow preference
+ * Get whether SSO should trump explicit relying party requirements preference.
+ *
+ * @return whether SSO should trump explicit relying party requirements preference
*/
public boolean getFavorSSO() {
return favorSSO;
}
/**
- * Set whether SSO should trump explicit relying party flow preference.
- *
- * @param flag whether SSO should trump explicit relying party flow preference
+ * Set whether SSO should trump explicit relying party requirements preference.
+ *
+ * @param flag whether SSO should trump explicit relying party requirements preference
*/
public void setFavorSSO(final boolean flag) {
[... 157 lines stripped ...]
More information about the commits
mailing list