0

I'm using Coldfusion Builder 2018 and running a coldfusion application in local. This application was protected with SSO and the server is setting CGI variables in Dev/Prod. I want to override this CGI variable in my local server to run the application.

Can someone help me on how to override the CGI variable in local?

S.Siva
  • 1,901
  • 4
  • 17
  • 22
  • Can you provide some examples of what you are trying? Which webserver are you using? – rrk Sep 02 '21 at 16:25
  • I'm using CF Server(Tomcat?) in local. – S.Siva Sep 02 '21 at 17:09
  • 1
    You can't overwrite CGI.HTTP_HOST values. It's refer from the URL / host value only. Even you can't manually update it. If you have local set up properly. It will have your local host value by default. – Kannan.P Sep 03 '21 at 14:40
  • 1
    Are you really using `CGI.HTTP_USERID`? I don't think that is a CGI variable. I know of `CGI.REMOTE_USER` or `CGI.AUTH_USER`. Did you try those? – Miguel-F Sep 03 '21 at 14:58
  • @Miguel-F That's a custom CGI variable set by the SSO process. It's not a default CF supplied value. – Adrian J. Moreno Sep 03 '21 at 16:26
  • Could you check for the existence of the variable? `` – Dan Bracuk Sep 05 '21 at 17:19
  • 2
    I'm perhaps re-task this as a Tomcat question, rather than a CF one. You're more likely to get a useful response from the Tomcat crowd than the CF one. You want to ask how to set bespoke CGI variables in Tomcat. I expect CF will just take whatever it's given, and expose them all in the CGI scope. – Adam Cameron Sep 06 '21 at 17:30

1 Answers1

1

I think your best bet is to create your own abstraction instead. So create a function / CFC that you get your variables from. Depending on environment you can get these from configuration (or something else), and in prod you can honour the CGI variables. I am not sure you can override CGI variables.

baynezy
  • 6,493
  • 10
  • 48
  • 73