Search in sources :

Example 1 with AuthenticationScheme

use of org.gluu.oxtrust.model.scim2.provider.AuthenticationScheme in project oxTrust by GluuFederation.

the class ServiceProviderConfigWS method listGroups.

@GET
@Produces(Constants.MEDIA_TYPE_SCIM_JSON + "; charset=utf-8")
@HeaderParam("Accept")
@DefaultValue(Constants.MEDIA_TYPE_SCIM_JSON)
public Response listGroups(@HeaderParam("Authorization") String authorization) throws Exception {
    ServiceProviderConfig serviceProviderConfig = new ServiceProviderConfig();
    Meta meta = new Meta();
    meta.setLocation(appConfiguration.getBaseEndpoint() + "/scim/v2/ServiceProviderConfig");
    meta.setResourceType("ServiceProviderConfig");
    serviceProviderConfig.setMeta(meta);
    ArrayList<AuthenticationScheme> authenticationSchemes = new ArrayList<AuthenticationScheme>();
    if (appConfiguration.isScimTestMode()) {
        log.info(" ##### SCIM Test Mode is ACTIVE");
        authenticationSchemes.add(AuthenticationScheme.createOAuth2(true));
    } else {
        authenticationSchemes.add(AuthenticationScheme.createUma(true));
    }
    serviceProviderConfig.setAuthenticationSchemes(authenticationSchemes);
    URI location = new URI(appConfiguration.getBaseEndpoint() + "/scim/v2/ServiceProviderConfig");
    return Response.ok(serviceProviderConfig).location(location).build();
}
Also used : AuthenticationScheme(org.gluu.oxtrust.model.scim2.provider.AuthenticationScheme) ServiceProviderConfig(org.gluu.oxtrust.model.scim2.provider.ServiceProviderConfig) Meta(org.gluu.oxtrust.model.scim2.Meta) ArrayList(java.util.ArrayList) URI(java.net.URI) DefaultValue(javax.ws.rs.DefaultValue) HeaderParam(javax.ws.rs.HeaderParam) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 DefaultValue (javax.ws.rs.DefaultValue)1 GET (javax.ws.rs.GET)1 HeaderParam (javax.ws.rs.HeaderParam)1 Produces (javax.ws.rs.Produces)1 Meta (org.gluu.oxtrust.model.scim2.Meta)1 AuthenticationScheme (org.gluu.oxtrust.model.scim2.provider.AuthenticationScheme)1 ServiceProviderConfig (org.gluu.oxtrust.model.scim2.provider.ServiceProviderConfig)1