Search in sources :

Example 1 with OxAuthJsonConfiguration

use of org.gluu.oxtrust.api.server.model.OxAuthJsonConfiguration in project oxTrust by GluuFederation.

the class OxAuthJsonSettingWebResource method getOxAuthJsonSettings.

@GET
@Operation(summary = "Get json oxauth settings", description = "Gets oxAuth configuration in JSON format", responses = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = OxAuthJsonConfiguration.class)), description = Constants.RESULT_SUCCESS), @ApiResponse(responseCode = "500", description = "Server error") })
@ProtectedApi(scopes = { READ_ACCESS })
public Response getOxAuthJsonSettings() {
    try {
        log(logger, "Processing oxauth json settings retrieval request");
        this.oxAuthDynamicConfigJson = jsonConfigurationService.getOxAuthDynamicConfigJson();
        OxAuthJsonConfiguration configuration = new ObjectMapper().readValue(this.oxAuthDynamicConfigJson, OxAuthJsonConfiguration.class);
        return Response.ok(configuration).build();
    } catch (Exception e) {
        log(logger, e);
        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
    }
}
Also used : OxAuthJsonConfiguration(org.gluu.oxtrust.api.server.model.OxAuthJsonConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ProtectedApi(org.gluu.oxtrust.service.filter.ProtectedApi) Operation(io.swagger.v3.oas.annotations.Operation)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Operation (io.swagger.v3.oas.annotations.Operation)1 OxAuthJsonConfiguration (org.gluu.oxtrust.api.server.model.OxAuthJsonConfiguration)1 ProtectedApi (org.gluu.oxtrust.service.filter.ProtectedApi)1