ssoService.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI); ssoService.setLocation(spMetadata.getSloUrl()); spSSODescriptor.getSingleLogoutServices().add(ssoService); spSSODescriptor.getSingleLogoutServices().add(ssoService2);
public static String getLogoutBinding(IDPSSODescriptor idp, SPSSODescriptor sp) throws MetadataProviderException { List<SingleLogoutService> logoutServices = idp.getSingleLogoutServices(); if (logoutServices.size() == 0) { throw new MetadataProviderException("IDP doesn't contain any SingleLogout endpoints"); } String binding = null; // Let's find first binding supported by both IDP and SP idp: for (SingleLogoutService idpService : logoutServices) { for (SingleLogoutService spService : sp.getSingleLogoutServices()) { if (idpService.getBinding().equals(spService.getBinding())) { binding = idpService.getBinding(); break idp; } } } // In case there's no common endpoint let's use first available if (binding == null) { binding = idp.getSingleLogoutServices().iterator().next().getBinding(); } return binding; }
private void setSingleLogoutServices(SPSSODescriptor spssoDescriptor, SAMLSSOServiceProviderDO samlssoServiceProviderDO) { List<SingleLogoutService> singleLogoutServices = spssoDescriptor.getSingleLogoutServices(); if (singleLogoutServices != null && singleLogoutServices.size() > 0) { boolean foundSingleLogoutServicePostBinding = false; for (SingleLogoutService singleLogoutService : singleLogoutServices) { if (singleLogoutService.getBinding().equals(SAMLConstants.SAML2_POST_BINDING_URI)) { samlssoServiceProviderDO.setSloRequestURL(singleLogoutService.getLocation()); samlssoServiceProviderDO.setSloResponseURL(singleLogoutService.getResponseLocation());//changed foundSingleLogoutServicePostBinding = true; break; } } samlssoServiceProviderDO.setSloRequestURL(singleLogoutServices.get(0).getLocation()); samlssoServiceProviderDO.setSloResponseURL(singleLogoutServices.get(0).getResponseLocation());//chnaged samlssoServiceProviderDO.setDoSingleLogout(true); } else { samlssoServiceProviderDO.setDoSingleLogout(false); } }
private void setSingleLogoutServices(SPSSODescriptor spssoDescriptor, SAMLSSOServiceProviderDO samlssoServiceProviderDO){ List<SingleLogoutService> singleLogoutServices = spssoDescriptor.getSingleLogoutServices(); if (singleLogoutServices!=null && singleLogoutServices.size()>0) { boolean foundSingleLogoutServicePostBinding = false; for (SingleLogoutService singleLogoutService : singleLogoutServices) { if (singleLogoutService.getBinding().equals(SAMLConstants.SAML2_POST_BINDING_URI)) { samlssoServiceProviderDO.setSloRequestURL(singleLogoutService.getLocation()); samlssoServiceProviderDO.setSloResponseURL(singleLogoutService.getResponseLocation());//changed foundSingleLogoutServicePostBinding = true; break; } } if (!foundSingleLogoutServicePostBinding) { } samlssoServiceProviderDO.setSloRequestURL(singleLogoutServices.get(0).getLocation()); samlssoServiceProviderDO.setSloResponseURL(singleLogoutServices.get(0).getResponseLocation());//chnaged samlssoServiceProviderDO.setDoSingleLogout(true); } else { samlssoServiceProviderDO.setDoSingleLogout(false); } } private void setX509Certificate(EntityDescriptor entityDescriptor,SPSSODescriptor spssoDescriptor, SAMLSSOServiceProviderDO samlssoServiceProviderDO){
spDescriptor.getSingleLogoutServices().add(getSingleLogoutService(entityBaseURL, entityAlias, SAMLConstants.SAML2_POST_BINDING_URI)); spDescriptor.getSingleLogoutServices().add(getSingleLogoutService(entityBaseURL, entityAlias, SAMLConstants.SAML2_REDIRECT_BINDING_URI)); spDescriptor.getSingleLogoutServices().add(getSingleLogoutService(entityBaseURL, entityAlias, SAMLConstants.SAML2_SOAP11_BINDING_URI));
List<SingleLogoutService> services = localDescriptor.getSingleLogoutServices(); boolean found = false; for (SingleLogoutService service : services) {