Forum Discussion
kirkpabk
Altostratus
Sep 19, 2023Redirect/Rewrite to Same Host URL different Host with App AD FS Authentication
So say we have a redirect/rewrite in place which performs a redirect for https://myapp.site.com/ (in VM host) to https://myapp.site.com/ (in kubernetes container host) The new location is also ...
Todd_Behrens_20
Nimbostratus
Dec 14, 2017i figured out my issues. i needed to add a statement to not insert the script if the url path isnt there. here is what i did if anyone is interested
when RULE_INIT {
Insert Token Javascript
set static::jscript {
}
}
when HTTP_REQUEST {
This is the condition for which requests will be matched against
if {[HTTP::uri] contains "/Anakin"} {
set enableEum 1
}
else {
set enableEum 0
}
Disable the stream filter for client requests as we are only interested in the server response
STREAM::disable
set uri [string tolower [HTTP::uri]]
}
when HTTP_RESPONSE {
if {($enableEum == 1) } {
if { [HTTP::status] == 200 } {
if {[HTTP::header value Content-Type] contains "text"} {
set stream_find ""
set stream_find_lower ""
set stream_repl ""
set insertJscript 1
Do not allow the Javascript insertion if the pages end with the following
switch -glob $uri {
"*.ashx*" -
"*.asmx*" -
"*.axd*" -
"*.js*" {
set insertJscript 0
}
default {
if { [HTTP::payload] contains "META HTTP-EQUIV=\"Refresh\""} {
set insertJscript 0
}
}
}
if {$insertJscript == 1} {
append stream_repl $static::jscript
append stream_expression "@$stream_find@$stream_repl$stream_find@"
append stream_expression "@$stream_find_lower@$stream_repl$stream_find_lower@"
STREAM::expression $stream_expression
STREAM::enable
}
}
}
}
}
- harunkaraOct 20, 2020
Nimbostratus
My guess is that customer didn't follow the guidance located here https://www.f5.com/services/resources/deployment-guides/microsoft-sharepoint-2016-big-ip-v114-v12-ltm-apm-asm-afm-aam
I will tell them about this deployment guide once i am able contact them. Meanwhile can you confirm this is the right way and if we follow the document linked above we should be resovling the problems i have shown?