Forum Discussion
Dave_Hatfield_2
Nimbostratus
Dec 08, 2010after login 2nd redirect causing problems
We have a primary site called "eschool.oursite.org" that we want to auto redirect to another site "portal.oursite.org/eschool". From this site the users can click on a link to take them back to the login page "eschool.oursite.org/webapps/login".
The irule below works for the first part (redirect to our portal site). Clicking on the login link takes them correctly back to the login page "eschool.oursite.org/webapps/login" but when they put in their credentials they are redirected again to our portal and if they click on the login link again they are already authenticated and go fully into our "eschool.oursite.org" site.
The login form uses the following code:
form onsubmit="return validate_form(this,false)" method="post" action="https://eschool.mysite.org/webapps/login" name="login"
when CLIENT_ACCEPTED {
Set a variable to track whether this is an HTTPS request
set https 0
}
when CLIENTSSL_HANDSHAKE {
There was a client side SSL handshake, so update the variable
set https 1
}
when HTTP_REQUEST {
If there is no URI redirect to portal
if {[HTTP::path] eq "/" }{
HTTP::redirect "https://portal.oursite.org/eschool"
}
if {not ($https)}{
If it's not an HTTPS connection, send a redirect
HTTP::redirect https://[HTTP::host][HTTP::uri]
}
}
We are in dire straights till we get this resolved.
- hoolio
Cirrostratus
Hi Dave, - Dave_Hatfield_2
Nimbostratus
I updated my original post with the full irule and it is only being used on the vip for eschool.mysite.org and thanks for catching my live site info. - hoolio
Cirrostratus
Can you use a browser plugin to capture the HTTP requests/responses unencrypted? You can also use logging within the iRule to see what's being executed there. You can also add debug logging for redirects in HTTP_RESPONSE to see what the app is sending back:when HTTP_RESPONSE { Check for redirects from the pool member if {[HTTP::is_redirect]}{ log local0. "[IP::client_addr]:[TCP::client_port]: Redirect to [HTTP::header Location] from [IP::server_addr]:[TCP::server_port]" } }
- Dave_Hatfield_2
Nimbostratus
Here are lines from the log:
- Dave_Hatfield_2
Nimbostratus
Resolved the issue with re working the irule to examine the referrer: - hoolio
Cirrostratus
Hi Dave,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects