Search in sources :

Example 6 with AnonymousAuthenticationHandler

use of org.apache.syncope.client.lib.AnonymousAuthenticationHandler in project syncope by apache.

the class SAML2SPDetector method isSAML2SPAvailable.

public static boolean isSAML2SPAvailable() {
    synchronized (LOG) {
        if (ENABLED == null) {
            try {
                new SyncopeClientFactoryBean().setAddress(AbstractITCase.ADDRESS).setContentType(SyncopeClientFactoryBean.ContentType.XML).create(new AnonymousAuthenticationHandler(AbstractITCase.ANONYMOUS_UNAME, AbstractITCase.ANONYMOUS_KEY)).getService(SAML2SPService.class).getMetadata("http://localhost:9080/syncope", "saml2sp");
                ENABLED = true;
            } catch (Exception e) {
                // ignore
                ENABLED = false;
            }
        }
    }
    return ENABLED;
}
Also used : SAML2SPService(org.apache.syncope.common.rest.api.service.SAML2SPService) SyncopeClientFactoryBean(org.apache.syncope.client.lib.SyncopeClientFactoryBean) AnonymousAuthenticationHandler(org.apache.syncope.client.lib.AnonymousAuthenticationHandler)

Aggregations

AnonymousAuthenticationHandler (org.apache.syncope.client.lib.AnonymousAuthenticationHandler)6 SyncopeClientFactoryBean (org.apache.syncope.client.lib.SyncopeClientFactoryBean)3 AccessControlException (java.security.AccessControlException)2 Test (org.junit.jupiter.api.Test)2 Properties (java.util.Properties)1 ForbiddenException (javax.ws.rs.ForbiddenException)1 SyncopeClient (org.apache.syncope.client.lib.SyncopeClient)1 EntityTO (org.apache.syncope.common.lib.to.EntityTO)1 AnyQuery (org.apache.syncope.common.rest.api.beans.AnyQuery)1 SchemaQuery (org.apache.syncope.common.rest.api.beans.SchemaQuery)1 DomainService (org.apache.syncope.common.rest.api.service.DomainService)1 GroupService (org.apache.syncope.common.rest.api.service.GroupService)1 SAML2SPService (org.apache.syncope.common.rest.api.service.SAML2SPService)1 SchemaService (org.apache.syncope.common.rest.api.service.SchemaService)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1