use of org.gluu.oxtrust.util.CASProtocolConfiguration in project oxTrust by GluuFederation.
the class CasProtocolWebResource method update.
@PUT
@Operation(summary = "Update the configuration", description = "Update the configuration")
@ApiResponses(value = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = CasProtocolDTO.class)), description = "Success") })
@ProtectedApi(scopes = { WRITE_ACCESS })
public Response update(@Valid CasProtocolDTO casProtocol) {
log(logger, "Update the configuration");
try {
CASProtocolConfiguration casProtocolConfiguration = casProtocolDtoAssembly.fromDto(casProtocol);
casProtocolConfiguration.save(casService);
shibbolethService.update(casProtocolConfiguration);
return getCasConfig();
} catch (Exception e) {
log(logger, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
use of org.gluu.oxtrust.util.CASProtocolConfiguration in project oxTrust by GluuFederation.
the class CasProtocolWebResource method getCasConfig.
@GET
@Operation(summary = "Get existing configuration", description = "Get the existing configuration")
@ApiResponses(value = { @ApiResponse(responseCode = "200", content = @Content(schema = @Schema(implementation = CasProtocolDTO.class)), description = "Success") })
@ProtectedApi(scopes = { READ_ACCESS })
public Response getCasConfig() {
log(logger, "Get the existing cas configuration");
try {
CASProtocolConfiguration casProtocolConfiguration = casProtocolConfigurationProvider.get();
CasProtocolDTO casProtocolDto = casProtocolDtoAssembly.toDto(casProtocolConfiguration);
return Response.ok(casProtocolDto).build();
} catch (Exception e) {
log(logger, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
Aggregations