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());
}
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;
}
Aggregations