Search in sources :

Example 1 with ServiceProviderConfig

use of org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig in project syncope by apache.

the class SCIMITCase method serviceProviderConfig.

@Test
public void serviceProviderConfig() {
    assumeTrue(SCIMDetector.isSCIMAvailable(webClient()));
    Response response = webClient().path("ServiceProviderConfig").get();
    assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
    assertEquals(SCIMConstants.APPLICATION_SCIM_JSON, StringUtils.substringBefore(response.getHeaderString(HttpHeaders.CONTENT_TYPE), ";"));
    ServiceProviderConfig serviceProviderConfig = response.readEntity(ServiceProviderConfig.class);
    assertNotNull(serviceProviderConfig);
    assertFalse(serviceProviderConfig.getPatch().isSupported());
    assertFalse(serviceProviderConfig.getBulk().isSupported());
    assertTrue(serviceProviderConfig.getChangePassword().isSupported());
    assertTrue(serviceProviderConfig.getEtag().isSupported());
    assertTrue(serviceProviderConfig.getSort().isSupported());
}
Also used : ListResponse(org.apache.syncope.ext.scimv2.api.data.ListResponse) Response(javax.ws.rs.core.Response) ServiceProviderConfig(org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig) Test(org.junit.jupiter.api.Test)

Example 2 with ServiceProviderConfig

use of org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig in project syncope by apache.

the class SCIMLogic method serviceProviderConfig.

@PreAuthorize("isAuthenticated()")
public ServiceProviderConfig serviceProviderConfig(final UriBuilder uriBuilder) {
    synchronized (MONITOR) {
        if (SCHEMAS == null) {
            init();
        }
        if (SERVICE_PROVIDER_CONFIG == null) {
            SCIMConf conf = confManager.get();
            SERVICE_PROVIDER_CONFIG = new ServiceProviderConfig(new Meta(Resource.ServiceProviderConfig, conf.getCreationDate(), conf.getLastChangeDate(), conf.getETagValue(), uriBuilder.build().toASCIIString()), new ConfigurationOption(false), new BulkConfigurationOption(false, conf.getBulkMaxOperations(), conf.getBulkMaxPayloadSize()), new FilterConfigurationOption(true, conf.getFilterMaxResults()), new ConfigurationOption(true), new ConfigurationOption(true), new ConfigurationOption(true));
            SERVICE_PROVIDER_CONFIG.getAuthenticationSchemes().add(new AuthenticationScheme("JSON Web Token", "Apache Syncope JWT authentication", URI.create("http://www.rfc-editor.org/info/rfc6750"), URI.create("https://syncope.apache.org/docs/" + "reference-guide.html#rest-authentication-and-authorization"), "oauthbearertoken", true));
            SERVICE_PROVIDER_CONFIG.getAuthenticationSchemes().add(new AuthenticationScheme("HTTP Basic", "Apache Syncope HTTP Basic authentication", URI.create("http://www.rfc-editor.org/info/rfc2617"), URI.create("https://syncope.apache.org/docs/" + "reference-guide.html#rest-authentication-and-authorization"), "httpbasic", false));
        }
    }
    return SERVICE_PROVIDER_CONFIG;
}
Also used : AuthenticationScheme(org.apache.syncope.ext.scimv2.api.data.AuthenticationScheme) ServiceProviderConfig(org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig) Meta(org.apache.syncope.ext.scimv2.api.data.Meta) FilterConfigurationOption(org.apache.syncope.ext.scimv2.api.data.FilterConfigurationOption) BulkConfigurationOption(org.apache.syncope.ext.scimv2.api.data.BulkConfigurationOption) ConfigurationOption(org.apache.syncope.ext.scimv2.api.data.ConfigurationOption) FilterConfigurationOption(org.apache.syncope.ext.scimv2.api.data.FilterConfigurationOption) BulkConfigurationOption(org.apache.syncope.ext.scimv2.api.data.BulkConfigurationOption) SCIMConf(org.apache.syncope.common.lib.scim.SCIMConf) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Aggregations

ServiceProviderConfig (org.apache.syncope.ext.scimv2.api.data.ServiceProviderConfig)2 Response (javax.ws.rs.core.Response)1 SCIMConf (org.apache.syncope.common.lib.scim.SCIMConf)1 AuthenticationScheme (org.apache.syncope.ext.scimv2.api.data.AuthenticationScheme)1 BulkConfigurationOption (org.apache.syncope.ext.scimv2.api.data.BulkConfigurationOption)1 ConfigurationOption (org.apache.syncope.ext.scimv2.api.data.ConfigurationOption)1 FilterConfigurationOption (org.apache.syncope.ext.scimv2.api.data.FilterConfigurationOption)1 ListResponse (org.apache.syncope.ext.scimv2.api.data.ListResponse)1 Meta (org.apache.syncope.ext.scimv2.api.data.Meta)1 Test (org.junit.jupiter.api.Test)1 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)1