} catch (Exception ex) { log.errorv("The specified resolver {0} could NOT be loaded. Keycloak is unconfigured and will deny all requests. Reason: {1}", configResolverClass, ex.getMessage()); deploymentContext = new SamlDeploymentContext(new DefaultSamlDeployment()); if (is == null) { log.error("No adapter configuration. Keycloak is unconfigured and will deny all requests."); deployment = new DefaultSamlDeployment(); } else { try {
public SamlDeployment build(InputStream xml, ResourceLoader resourceLoader) throws ParsingException { DefaultSamlDeployment deployment = new DefaultSamlDeployment(); DefaultSamlDeployment.DefaultIDP idp = new DefaultSamlDeployment.DefaultIDP(); DefaultSamlDeployment.DefaultSingleSignOnService sso = new DefaultSamlDeployment.DefaultSingleSignOnService(); deployment.setConfigured(true); deployment.setEntityID(sp.getEntityID()); try { URI.create(sp.getEntityID()); deployment.setForceAuthentication(sp.isForceAuthentication()); deployment.setIsPassive(sp.isIsPassive()); deployment.setNameIDPolicyFormat(sp.getNameIDPolicyFormat()); deployment.setLogoutPage(sp.getLogoutPage()); deployment.setSignatureCanonicalizationMethod(sp.getIdp().getSignatureCanonicalizationMethod()); deployment.setAutodetectBearerOnly(sp.isAutodetectBearerOnly()); deployment.setSignatureAlgorithm(SignatureAlgorithm.RSA_SHA256); if (sp.getIdp().getSignatureAlgorithm() != null) { deployment.setSignatureAlgorithm(SignatureAlgorithm.valueOf(sp.getIdp().getSignatureAlgorithm())); deployment.setPrincipalNamePolicy(policy); deployment.setPrincipalAttributeName(sp.getPrincipalNameMapping().getAttributeName()); deployment.setRoleAttributeNames(sp.getRoleAttributes()); if (sp.getRoleAttributes() == null) { Set<String> roles = new HashSet<>(); roles.add("Role"); deployment.setRoleAttributeNames(roles); deployment.setSslRequired(ssl);