defaultHostname, portConfig.port())); authnRequest.setProtocolBinding(acsEndpoint.bindingProtocol().urn());
/** {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { AuthnRequest req = (AuthnRequest) samlObject; if (attribute.getLocalName().equals(AuthnRequest.FORCE_AUTHN_ATTRIB_NAME)) { req.setForceAuthn(XSBooleanValue.valueOf(attribute.getValue())); } else if (attribute.getLocalName().equals(AuthnRequest.IS_PASSIVE_ATTRIB_NAME)) { req.setIsPassive(XSBooleanValue.valueOf(attribute.getValue())); } else if (attribute.getLocalName().equals(AuthnRequest.PROTOCOL_BINDING_ATTRIB_NAME)) { req.setProtocolBinding(attribute.getValue()); } else if (attribute.getLocalName().equals(AuthnRequest.ASSERTION_CONSUMER_SERVICE_INDEX_ATTRIB_NAME)) { req.setAssertionConsumerServiceIndex(Integer.valueOf(attribute.getValue())); } else if (attribute.getLocalName().equals(AuthnRequest.ASSERTION_CONSUMER_SERVICE_URL_ATTRIB_NAME)) { req.setAssertionConsumerServiceURL(attribute.getValue()); } else if (attribute.getLocalName().equals(AuthnRequest.ATTRIBUTE_CONSUMING_SERVICE_INDEX_ATTRIB_NAME)) { req.setAttributeConsumingServiceIndex(Integer.valueOf(attribute.getValue())); } else if (attribute.getLocalName().equals(AuthnRequest.PROVIDER_NAME_ATTRIB_NAME)) { req.setProviderName(attribute.getValue()); } else { super.processAttribute(samlObject, attribute); } }
@SuppressWarnings("unchecked") //CHECKSTYLE:OFF public static AuthnRequest createAuthnRequest( String serviceURL, boolean forceAuthn, boolean isPassive, String protocolBinding, SAMLVersion version, Issuer issuer, NameIDPolicy nameIDPolicy, RequestedAuthnContext requestedAuthnCtx ) { //CHECKSTYLE:ON if (authnRequestBuilder == null) { authnRequestBuilder = (SAMLObjectBuilder<AuthnRequest>) builderFactory.getBuilder(AuthnRequest.DEFAULT_ELEMENT_NAME); } AuthnRequest authnRequest = authnRequestBuilder.buildObject(); authnRequest.setAssertionConsumerServiceURL(serviceURL); authnRequest.setForceAuthn(forceAuthn); authnRequest.setID("_" + UUID.randomUUID()); authnRequest.setIsPassive(isPassive); authnRequest.setIssueInstant(new DateTime()); authnRequest.setProtocolBinding(protocolBinding); authnRequest.setVersion(version); authnRequest.setIssuer(issuer); authnRequest.setNameIDPolicy(nameIDPolicy); authnRequest.setRequestedAuthnContext(requestedAuthnCtx); return authnRequest; }
authnRequest.setIssuer(issuer); authnRequest.setProtocolBinding(SAMLConstants.SAML2_POST_BINDING_URI); val pBuilder = (SAMLObjectBuilder) configBean.getBuilderFactory().getBuilder(NameIDPolicy.DEFAULT_ELEMENT_NAME); val nameIDPolicy = (NameIDPolicy) pBuilder.buildObject();
authnRequest.setIsPassive(false); authnRequest.setVersion(SAMLVersion.VERSION_20); authnRequest.setProtocolBinding(idp.getBindingType().getUri()); authnRequest.setIssueInstant(new DateTime()); authnRequest.setIssuer(issuer);
Optional.ofNullable((Boolean) (request.getAttribute(Constants.IS_PASSIVE_AUTH_ENABLED))) .orElse(false)); authnRequest.setProtocolBinding(contextConfiguration.getHttpBinding());
defaultHostname, portConfig.port())); authnRequest.setProtocolBinding(acsEndpoint.bindingProtocol().urn());
request.setAssertionConsumerServiceURL(assertionConsumerService.getLocation()); request.setProtocolBinding(assertionConsumerService.getBinding());
protected AuthnRequest internalToXml(AuthenticationRequest request) { AuthnRequest auth = buildSAMLObject(AuthnRequest.class); auth.setID(request.getId()); auth.setVersion(SAMLVersion.VERSION_20); auth.setIssueInstant(request.getIssueInstant()); auth.setForceAuthn(request.isForceAuth()); auth.setIsPassive(request.isPassive()); auth.setProtocolBinding(request.getBinding().toString()); // Azure AD as IdP will not accept index if protocol binding or AssertationCustomerServiceURL is set. // auth.setAssertionConsumerServiceIndex(request.getAssertionConsumerService().getIndex()); auth.setAssertionConsumerServiceURL(request.getAssertionConsumerService().getLocation()); auth.setDestination(request.getDestination().getLocation()); auth.setNameIDPolicy(getNameIDPolicy(request.getNameIdPolicy())); auth.setRequestedAuthnContext(getRequestedAuthenticationContext(request)); auth.setIssuer(toIssuer(request.getIssuer())); if (request.getSigningKey() != null) { this.signObject(auth, request.getSigningKey(), request.getAlgorithm(), request.getDigest()); } return auth; }