Search in sources :

Example 1 with ServiceProviderConfig

use of io.jans.scim.model.scim2.provider.config.ServiceProviderConfig in project oxTrust by GluuFederation.

the class ServiceProviderConfigWS method serve.

@GET
@Produces(MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT)
@HeaderParam("Accept")
@DefaultValue(MEDIA_TYPE_SCIM_JSON)
@RejectFilterParam
public Response serve() {
    try {
        ServiceProviderConfig serviceProviderConfig = new ServiceProviderConfig();
        serviceProviderConfig.getFilter().setMaxResults(appConfiguration.getScimProperties().getMaxCount());
        Meta meta = new Meta();
        meta.setLocation(endpointUrl);
        meta.setResourceType(ScimResourceUtil.getType(serviceProviderConfig.getClass()));
        serviceProviderConfig.setMeta(meta);
        boolean onTestMode = appConfiguration.isScimTestMode();
        serviceProviderConfig.setAuthenticationSchemes(Arrays.asList(AuthenticationScheme.createOAuth2(onTestMode), AuthenticationScheme.createUma(!onTestMode)));
        return Response.ok(resourceSerializer.serialize(serviceProviderConfig)).build();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return getErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, "Unexpected error: " + e.getMessage());
    }
}
Also used : ServiceProviderConfig(org.gluu.oxtrust.model.scim2.provider.config.ServiceProviderConfig) Meta(org.gluu.oxtrust.model.scim2.Meta) DefaultValue(javax.ws.rs.DefaultValue) HeaderParam(javax.ws.rs.HeaderParam) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) RejectFilterParam(org.gluu.oxtrust.service.scim2.interceptor.RejectFilterParam)

Example 2 with ServiceProviderConfig

use of io.jans.scim.model.scim2.provider.config.ServiceProviderConfig in project jans by JanssenProject.

the class ServiceProviderConfigWS method serve.

@GET
@Produces(MEDIA_TYPE_SCIM_JSON + UTF8_CHARSET_FRAGMENT)
@HeaderParam("Accept")
@DefaultValue(MEDIA_TYPE_SCIM_JSON)
@RejectFilterParam
public Response serve() {
    try {
        ServiceProviderConfig serviceProviderConfig = new ServiceProviderConfig();
        serviceProviderConfig.getFilter().setMaxResults(appConfiguration.getMaxCount());
        Meta meta = new Meta();
        meta.setLocation(endpointUrl);
        meta.setResourceType(ScimResourceUtil.getType(serviceProviderConfig.getClass()));
        serviceProviderConfig.setMeta(meta);
        serviceProviderConfig.setAuthenticationSchemes(Collections.singletonList(AuthenticationScheme.createOAuth2(true)));
        return Response.ok(resourceSerializer.serialize(serviceProviderConfig)).build();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return getErrorResponse(Response.Status.INTERNAL_SERVER_ERROR, "Unexpected error: " + e.getMessage());
    }
}
Also used : ServiceProviderConfig(io.jans.scim.model.scim2.provider.config.ServiceProviderConfig) Meta(io.jans.scim.model.scim2.Meta) DefaultValue(javax.ws.rs.DefaultValue) HeaderParam(javax.ws.rs.HeaderParam) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) RejectFilterParam(io.jans.scim.service.scim2.interceptor.RejectFilterParam)

Aggregations

DefaultValue (javax.ws.rs.DefaultValue)2 GET (javax.ws.rs.GET)2 HeaderParam (javax.ws.rs.HeaderParam)2 Produces (javax.ws.rs.Produces)2 Meta (io.jans.scim.model.scim2.Meta)1 ServiceProviderConfig (io.jans.scim.model.scim2.provider.config.ServiceProviderConfig)1 RejectFilterParam (io.jans.scim.service.scim2.interceptor.RejectFilterParam)1 Meta (org.gluu.oxtrust.model.scim2.Meta)1 ServiceProviderConfig (org.gluu.oxtrust.model.scim2.provider.config.ServiceProviderConfig)1 RejectFilterParam (org.gluu.oxtrust.service.scim2.interceptor.RejectFilterParam)1