Skip to main content Skip to navigation

SSO Taglib

The SSO taglib (sso.tld) is used to generate the complex login and logout links that SSOv3 requires. I can be used like this:

<c:choose>
  <c:when test="${SSO_USER != null && SSO_USER.loggedIn == true}">
    <p><a href="<sso:logoutlink />">Sign out</a></p>
  </c:when>
  <c:otherwise>
    <p><a href="<sso:loginlink />">Sign in</a></p>
  </c:otherwise>
</c:choose>

The generated urls are made up partly from the sso-config.xml file and partly from the incoming request. It is important to note that these tags HAVE to know the real requested url that is coming in, most likely the url requested that went through Apache, otherwise it will end up redirecting to the underlying app server (JBoss). This is achieved by configuring the following in the Apache rewrites that proxy through to JBoss:

RewriteCond %{REQUEST_URI} ^/myapp
RewriteRule ^(.+) http://myhost.warwick.ac.uk:8080%{REQUEST_FILENAME}?requestedUrl=%{ENV:SCRIPT_URI} [QSA,L,P]

The requestedUrl querystring is the real requested url and is picked up by the link generators and by SSOClientFilter.