[java-identity-provider] branch maint-4.1 updated: Revert "IDP-1831 - Uncaught Exception while proxying to Azure"
Scott Cantor
cantor.2 at osu.edu
Mon Jul 26 18:24:04 UTC 2021
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch maint-4.1
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=8253d51e01d0072a99fd532ece53e2076307c9dd
The following commit(s) were added to refs/heads/maint-4.1 by this push:
new 8253d51e0 Revert "IDP-1831 - Uncaught Exception while proxying to Azure"
8253d51e0 is described below
commit 8253d51e01d0072a99fd532ece53e2076307c9dd
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jul 26 14:23:21 2021 -0400
Revert "IDP-1831 - Uncaught Exception while proxying to Azure"
This reverts commit 7ecd283358cdda39344b1fc406a8a522ac5701d9.
---
.../saml2/profile/impl/SAMLAuthnController.java | 45 +++-------------------
1 file changed, 6 insertions(+), 39 deletions(-)
diff --git a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java
index 39cfd07bb..4c2f29df5 100644
--- a/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java
+++ b/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/SAMLAuthnController.java
@@ -18,7 +18,6 @@
package net.shibboleth.idp.saml.saml2.profile.impl;
import java.io.IOException;
-import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
@@ -39,8 +38,6 @@ import net.shibboleth.utilities.java.support.component.AbstractInitializableComp
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy;
-import net.shibboleth.utilities.java.support.security.impl.SecureRandomIdentifierGenerationStrategy;
import org.opensaml.messaging.context.MessageContext;
import org.opensaml.messaging.context.navigate.ChildContextLookup;
@@ -86,10 +83,7 @@ public class SAMLAuthnController extends AbstractInitializableComponent {
/** Map of binding short names to deduce inbound binding constant. */
@Nonnull @NonnullElements private Map<String,BindingDescriptor> bindingMap;
-
- /** Strategy used to locate the {@link IdentifierGenerationStrategy} to use. */
- @Nonnull private Function<ProfileRequestContext,IdentifierGenerationStrategy> idGeneratorLookupStrategy;
-
+
/** Constructor. */
public SAMLAuthnController() {
// PRC -> AC -> nested PRC
@@ -100,9 +94,6 @@ public class SAMLAuthnController extends AbstractInitializableComponent {
samlContextLookupStrategy = new ChildContextLookup<>(SAMLAuthnContext.class).compose(
new ChildContextLookup<>(AuthenticationContext.class));
- // Default strategy is a 16-byte secure random source.
- idGeneratorLookupStrategy = prc -> new SecureRandomIdentifierGenerationStrategy();
-
bindingMap = Collections.emptyMap();
}
@@ -131,19 +122,6 @@ public class SAMLAuthnController extends AbstractInitializableComponent {
samlContextLookupStrategy = Constraint.isNotNull(strategy, "SAMLAuthnContext lookup strategy cannot be null");
}
- /**
- * Set the strategy used to locate the {@link IdentifierGenerationStrategy} to use.
- *
- * @param strategy lookup strategy
- */
- public void setIdentifierGeneratorLookupStrategy(
- @Nonnull final Function<ProfileRequestContext,IdentifierGenerationStrategy> strategy) {
- ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-
- idGeneratorLookupStrategy =
- Constraint.isNotNull(strategy, "IdentifierGenerationStrategy lookup strategy cannot be null");
- }
-
/**
* Set inbound bindings to use to deduce ProtocolBinding attribute.
*
@@ -160,7 +138,7 @@ public class SAMLAuthnController extends AbstractInitializableComponent {
}
}
-// Checkstyle: CyclomaticComplexity|MethodLength OFF
+// Checkstyle: CyclomaticComplexity OFF
/**
* Outbound initiation of the process, triggered with a fixed addition to the path.
*
@@ -194,29 +172,18 @@ public class SAMLAuthnController extends AbstractInitializableComponent {
ExternalAuthentication.finishExternalAuthentication(key, httpRequest, httpResponse);
return;
}
-
- final IdentifierGenerationStrategy idGenerator = idGeneratorLookupStrategy.apply(nestedPRC);
- if (idGenerator == null) {
- log.error("No ID generator provided");
- httpRequest.setAttribute(ExternalAuthentication.AUTHENTICATION_ERROR_KEY, EventIds.INVALID_SEC_CFG);
- ExternalAuthentication.finishExternalAuthentication(key, httpRequest, httpResponse);
- return;
- }
// Fill in the AuthnRequest's ACS URL and set RelayState to the EA key.
- // Also freshen the ID and IssueInstant in case of re-execution via webflow.
if (nestedPRC.getOutboundMessageContext() != null &&
nestedPRC.getOutboundMessageContext().getMessage() instanceof AuthnRequest) {
- final AuthnRequest authnRequest = (AuthnRequest) nestedPRC.getOutboundMessageContext().getMessage();
SAMLBindingSupport.setRelayState(nestedPRC.getOutboundMessageContext(), key);
final StringBuffer url = httpRequest.getRequestURL();
- authnRequest.setAssertionConsumerServiceURL(url.substring(0, url.lastIndexOf("/start")));
+ ((AuthnRequest) nestedPRC.getOutboundMessageContext().getMessage()).setAssertionConsumerServiceURL(
+ url.substring(0, url.lastIndexOf("/start")));
final BindingDescriptor bd = bindingMap.get(binding);
if (bd != null) {
- authnRequest.setProtocolBinding(bd.getId());
+ ((AuthnRequest) nestedPRC.getOutboundMessageContext().getMessage()).setProtocolBinding(bd.getId());
}
- authnRequest.setID(idGenerator.generateIdentifier());
- authnRequest.setIssueInstant(Instant.now());
} else {
log.error("Outbound AuthnContext message not found");
httpRequest.setAttribute(ExternalAuthentication.AUTHENTICATION_ERROR_KEY, EventIds.INVALID_MESSAGE);
@@ -245,7 +212,7 @@ public class SAMLAuthnController extends AbstractInitializableComponent {
ExternalAuthentication.finishExternalAuthentication(key, httpRequest, httpResponse);
}
}
-// Checkstyle: CyclomaticComplexity|MethodLength ON
+// Checkstyle: CyclomaticComplexity ON
/**
* Inbound completion of the process, triggered by default for any methods.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list