src/main/java/org/hl7/davinci/ehrserver/authproxy/AuthProxy.java
/**
   * The endpoint that the first /auth/ endpoint redirects to, in order to associate the code returned
   * from the OAUTH server with the launch id.  This is a necessary step because the launch id does
   * not get passed in with the token request.
   * @param launch - the launch id is included in the path
   * @param reqParamValue - the parameters of the url should include only the code, state, and the original redirect url
   * @param httpServletResponse - the response object
   * @param request - the request recieved
   */
The endpoint that the first /auth/ endpoint redirects to, in order to associate the code returned
from the OAUTH server with the launch id.  This is a necessary step because the launch id does
not get passed in with the token request.
@param launch - the launch id is included in the path
@param reqParamValue - the parameters of the url should include only the code, state, and the original redirect url
@param httpServletResponse - the response object
@param request - the request recieved
The endpoint that the first / auth / endpoint redirects to in order to associate the code returned from the OAUTH server with the launch id . This is a necessary step because the launch id does not get passed in with the token request . @param launch - the launch id is included in the path @param reqParamValue - the parameters of the url should include only the code state and the original redirect url @param httpServletResponse - the response object @param request - the request recieved
@GetMapping("/_auth/{launch}")
  public void authSync(@PathVariable String launch, @RequestParam Map<String, String> reqParamValue, HttpServletResponse httpServletResponse, HttpServletRequest request) {
    logger.info("redirected to secondary auth endpoint to sync code/launch_id with each other");
    payloadDAO.updateCode(launch, reqParamValue.get("code"));
    UriComponentsBuilder forwardUrl = UriComponentsBuilder.fromHttpUrl(reqParamValue.get("redirect_uri")).queryParam("state", reqParamValue.get("state")).queryParam("code", reqParamValue.get("code"));
    httpServletResponse.setHeader("Location", forwardUrl.toUriString());
    httpServletResponse.setStatus(302);
  }
@ GetMapping ( "/_auth/{launch}" ) public void authSync ( @ PathVariable String launch , @ RequestParam Map < String , String > reqParamValue , HttpServletResponse httpServletResponse , HttpServletRequest request ) { logger . info ( "redirected to secondary auth endpoint to sync code/launch_id with each other" ) ; payloadDAO . updateCode ( launch , reqParamValue . get ( "code" ) ) ; UriComponentsBuilder forwardUrl = UriComponentsBuilder . fromHttpUrl ( reqParamValue . get ( "redirect_uri" ) ) . queryParam ( "state" , reqParamValue . get ( "state" ) ) . queryParam ( "code" , reqParamValue . get ( "code" ) ) ; httpServletResponse . setHeader ( "Location" , forwardUrl . toUriString ( ) ) ; httpServletResponse . setStatus ( 302 ) ; }
The endpoint that the first /auth/ endpoint redirects to, in order to associate the code returned
 from the OAUTH server with the launch id.
The endpoint that the first / auth / endpoint redirects to in order to associate the code returned from the OAUTH server with the launch id .