com.fivefaces.structureclient.controller.PatientAuthController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-structure-client Show documentation
Show all versions of common-structure-client Show documentation
structure Client for Five Faces
package com.fivefaces.structureclient.controller;
import com.fivefaces.cloud.workflow.WorkflowExecutionResult;
import com.fivefaces.cloud.workflow.WorkflowService;
import com.fivefaces.structure.query.builder.StructureQuery;
import com.fivefaces.structure.query.builder.criteria.BasicCriteria;
import com.fivefaces.structureclient.config.security.patient.PatientJwtTokenService;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@RestController
@RequestMapping("/pt-auth")
@Slf4j
public class PatientAuthController extends AbstractStructureController {
private final PatientJwtTokenService patientJwtTokenService;
private final WorkflowService workflowService;
@GetMapping(value = "/.well-known/jwks.json", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public byte[] getFile() {
return patientJwtTokenService.getJwtPublicKey().getBytes(StandardCharsets.UTF_8);
}
@GetMapping(value = "/.well-known/openid-configuration", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public ResponseEntity