Forum Discussion
cjunior
Feb 14, 2020Nacreous
Hey,
Analysing your code, I found a unreachable condition:
if { [HTTP::uri] starts_with "/logout-apm" } {
}
elseif { [HTTP::uri] starts_with "/logout-apm" } {
}
Maybe a typo?
Well, my understood on this case drive me to this code:
when HTTP_REQUEST {
set tid [ACCESS::session data get "session.oauth.jwt.payload.last.tid"]
log local0. "tid value is $tid"
if { [HTTP::uri] starts_with "/logout-apm" } {
if { [HTTP::uri] contains "post_logout_redirect_uri"} {
set postLogoutValue [URI::query [HTTP::uri] post_logout_redirect_uri]
if { $tid contains "bbbbbbbb-vvvv-qqqq-yyyy-xxxxxxxxxxx" } {
HTTP::redirect "https://login-test.wecenergygroup.com/bbbbbbbb-vvvv-qqqq-yyyy-xxxxxxxxxxx/oauth2/v2.0/logout?p=b2c_1a_ya_signup_signin&&post_logout_redirect_uri=https://[HTTP::host]$postLogoutValue"
return
} elseif { $tid contains "uuuuuuuu-vvvv-qqqq-pppp-pppppppppp" } {
HTTP::redirect "https://login.microsoftonline.com/common/oauth2/v2.0/logout?post_logout_redirect_uri=https://[HTTP::host]$postLogoutValue"
return
}
}
HTTP::redirect "https://login.microsoftonline.com/common/oauth2/v2.0/logout"
}
}
Am I right and fix that?
Regards.