Skip to content

Commit

Permalink
Auth url change
Browse files Browse the repository at this point in the history
  • Loading branch information
bstewartlg committed Jun 28, 2024
1 parent 4f4abbf commit c152f61
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.hl7.davinci.priorauth.App;
import org.hl7.davinci.priorauth.Audit;
import org.hl7.davinci.priorauth.FhirUtils;
Expand Down Expand Up @@ -179,6 +180,10 @@ private CapabilityStatementRestSecurityComponent getSecurity(HttpServletRequest
if (System.getenv("TOKEN_BASE_URI") != null && !System.getenv("TOKEN_BASE_URI").isBlank()) {
uriBase = System.getenv("TOKEN_BASE_URI");
}
else if (StringUtils.isNotBlank(request.getHeader("X-Forwarded-Proto")) && StringUtils.isNotBlank(request.getHeader("X-Forwarded-Host"))) {
uriBase = request.getHeader("X-Forwarded-Proto") + "://" + request.getHeader("X-Forwarded-Host");
}

Extension tokenUri = new Extension("token", new UriType(uriBase + "/fhir/auth/token"));
Extension authorizeUri = new Extension("authorize", new UriType(uriBase + "/fhir/auth/authorize"));
oauthUris.addExtension(tokenUri);
Expand Down

0 comments on commit c152f61

Please sign in to comment.