Apache vhost configuration: set applicationID dynamically

Philipp, Daniel Daniel.Philipp at tds.fujitsu.com
Wed Oct 2 10:47:18 EDT 2013


Hello altogether,

Sotware Version Info:
Shibboleth SP 2.5.1
Apache/2.2.20
IdP: Picketlink 1.3(?)

Actually, we have a quite smooth working Apache/Shibboleth setup but have to extend it as follows.

Based on the referrer we want to set the applicationID for <Location /> dynamically.
I thought it should work like this in the corresponding vhost configuration:

	# default application id
	SetEnv MYAPPID appid1
	# some referrers
	SetEnvIf Referer "^https://example2\.com/" MYAPPID=appid2
	SetEnvIf Referer "^https://example3\.com/" MYAPPID=appid3
	SetEnvIf Referer "^https://example4\.com/" MYAPPID=appid4
	SetEnvIf Referer "^https://example5\.com/" MYAPPID=appid5

	<Location />
		AuthType shibboleth
        	ShibRequestSetting applicationID "%{MYAPPID}"
		ShibRequireSession On
		Require valid-user
	</Location>

Setting the environment variable MYAPPID isn't a problem, I get the correct value shown accordingly to the referrer
that was sent.
The problem is: ShibRequestSetting applicationID wants a literal string which must refer to the corresponding application override configuration.
Thus, I can't set the value dynamically.

I know there's a possibility in Apache 2.4 by using the <If>..</If> directive, but we are stuck with Apache 2.2.X.

Do you have any clue how to work around or solve this issue?
We are only allowed to make changes on Shibboleth SP and Apache side - not on any other component involved.


Best Regards and thanks in advance.
Daniel


More information about the users mailing list