Search in sources :

Example 16 with SingleLogoutServiceElement

use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.

the class SLOLocationTest method sameBindingReturnedWhenAvailable.

public void sameBindingReturnedWhenAvailable() {
    List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
    endpoints.add(endpointFor(HTTP_REDIRECT, "redirect"));
    endpoints.add(endpointFor(HTTP_POST, "post"));
    endpoints.add(endpointFor(SOAP, "soap"));
    SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_REDIRECT);
    assertThat(result.getBinding()).isEqualTo(HTTP_REDIRECT);
    result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_POST);
    assertThat(result.getBinding()).isEqualTo(HTTP_POST);
    result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, SOAP);
    assertThat(result.getBinding()).isEqualTo(SOAP);
}
Also used : SingleLogoutServiceElement(com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement) ArrayList(java.util.ArrayList)

Example 17 with SingleLogoutServiceElement

use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.

the class SLOLocationTest method endpointFor.

private SingleLogoutServiceElement endpointFor(String binding, String location) {
    SingleLogoutServiceElement ret = new SingleLogoutServiceElementImpl();
    ret.setBinding(binding);
    ret.setLocation(location);
    return ret;
}
Also used : SingleLogoutServiceElement(com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement) SingleLogoutServiceElementImpl(com.sun.identity.saml2.jaxb.metadata.impl.SingleLogoutServiceElementImpl)

Example 18 with SingleLogoutServiceElement

use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.

the class SLOLocationTest method nullReturnedIfNoBindingAvailable.

public void nullReturnedIfNoBindingAvailable() {
    List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
    SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_REDIRECT);
    assertThat(result).isNull();
    result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_POST);
    assertThat(result).isNull();
    result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, SOAP);
    assertThat(result).isNull();
}
Also used : SingleLogoutServiceElement(com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement) ArrayList(java.util.ArrayList)

Example 19 with SingleLogoutServiceElement

use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.

the class SLOLocationTest method asynchronousBindingsAreNotReturnedWhenRequestingSynchronous.

public void asynchronousBindingsAreNotReturnedWhenRequestingSynchronous() {
    List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
    endpoints.add(endpointFor(HTTP_REDIRECT, "redirect"));
    endpoints.add(endpointFor(HTTP_POST, "post"));
    SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, SOAP);
    assertThat(result).isNull();
}
Also used : SingleLogoutServiceElement(com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement) ArrayList(java.util.ArrayList)

Example 20 with SingleLogoutServiceElement

use of com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement in project OpenAM by OpenRock.

the class SLOLocationTest method synchronousBindingReturnedIfNoAsynchronousAvailable.

public void synchronousBindingReturnedIfNoAsynchronousAvailable() {
    List<SingleLogoutServiceElement> endpoints = new ArrayList<SingleLogoutServiceElement>();
    endpoints.add(endpointFor(SOAP, "soap"));
    SingleLogoutServiceElement result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_REDIRECT);
    assertThat(result.getBinding()).isEqualTo(SOAP);
    result = LogoutUtil.getMostAppropriateSLOServiceLocation(endpoints, HTTP_POST);
    assertThat(result.getBinding()).isEqualTo(SOAP);
}
Also used : SingleLogoutServiceElement(com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement) ArrayList(java.util.ArrayList)

Aggregations

SingleLogoutServiceElement (com.sun.identity.saml2.jaxb.metadata.SingleLogoutServiceElement)25 ArrayList (java.util.ArrayList)9 List (java.util.List)8 SAML2Exception (com.sun.identity.saml2.common.SAML2Exception)7 SAML2MetaException (com.sun.identity.saml2.meta.SAML2MetaException)6 HashMap (java.util.HashMap)6 SessionException (com.sun.identity.plugin.session.SessionException)5 SAML2TokenRepositoryException (org.forgerock.openam.federation.saml2.SAML2TokenRepositoryException)5 IOException (java.io.IOException)4 HashSet (java.util.HashSet)4 Iterator (java.util.Iterator)4 Map (java.util.Map)4 Set (java.util.Set)4 SPSSOConfigElement (com.sun.identity.saml2.jaxb.entityconfig.SPSSOConfigElement)3 IDPSSODescriptorElement (com.sun.identity.saml2.jaxb.metadata.IDPSSODescriptorElement)3 SPSSODescriptorElement (com.sun.identity.saml2.jaxb.metadata.SPSSODescriptorElement)3 LogoutResponse (com.sun.identity.saml2.protocol.LogoutResponse)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 SingleLogoutManager (com.sun.identity.multiprotocol.SingleLogoutManager)2 SessionProvider (com.sun.identity.plugin.session.SessionProvider)2