[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/views/login.vm idp-war/src/main/webapp/WEB-INF...

noreply at shibboleth.net noreply at shibboleth.net
Mon Sep 15 20:20:55 EDT 2014


Author: scantor
Date: Mon Sep 15 20:20:54 2014
New Revision: 6530

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6530&view=rev
Log:
Clean up detection of service names, show field labels.

Modified:
    trunk/idp-conf/src/main/resources/views/login.vm
    trunk/idp-war/src/main/webapp/WEB-INF/jsp/login.jsp
    trunk/idp-war/src/main/webapp/css/main.css

Modified: trunk/idp-conf/src/main/resources/views/login.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/views/login.vm?rev=6530&r1=6529&r2=6530&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/views/login.vm (original)
+++ trunk/idp-conf/src/main/resources/views/login.vm Mon Sep 15 20:20:54 2014
@@ -10,8 +10,8 @@
 ## request - HttpServletRequest
 ## response - HttpServletResponse
 
-#set ($username = $authenticationContext.getSubcontext('net.shibboleth.idp.authn.context.UsernamePasswordContext', true).getUsername() )
-
+#set ( $username = $authenticationContext.getSubcontext('net.shibboleth.idp.authn.context.UsernamePasswordContext', true).getUsername() )
+#set ( $rpContext = $profileRequestContext.getSubcontext('net.shibboleth.idp.profile.context.RelyingPartyContext') )
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   	<head>
     	<meta charset="utf-8" />
@@ -43,20 +43,20 @@
                 </p>
               #end
 
-              #if ( $rpUIContext.getServiceName() )
+              #if ( !$rpContext.getRelyingPartyId().contains($rpUIContext.getServiceName()) )
                 <legend>
                   Login to $encoder.encodeForHTML($rpUIContext.getServiceName())
                 </legend>
               #end
 
               <section>
-                <Label for="username">Username</label>
+                <label for="j_username">Username</label>
                 <input class="form-element form-field" name="j_username" type="text"
                 	value="#if($username)$encoder.encodeForHTML($username)#end">
               </section>
 
               <section>
-                <label for="password">Password</label>
+                <label for="j_password">Password</label>
                 <input class="form-element form-field" name="j_password" type="password" value="">
               </section>
 
@@ -86,11 +86,12 @@
             -->
             #set ($logo = $rpUIContext.getLogo())
             #if ($logo)
-                <img src= "$encoder.encodeForHTMLAttribute($logo)" alt="logo for $rpUIContext.getServiceName()"/>
+              <img src= "$encoder.encodeForHTMLAttribute($logo)"
+                  alt="logo for $encoder.encodeForHTMLAttribute($rpUIContext.getServiceName())"/>
             #end
             #set ($desc = $rpUIContext.getServiceDescription())
             #if ($desc)
-              $desc
+              $encoder.encodeForHTML($desc)
             #end
             
           </div>

Modified: trunk/idp-war/src/main/webapp/WEB-INF/jsp/login.jsp
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-war/src/main/webapp/WEB-INF/jsp/login.jsp?rev=6530&r1=6529&r2=6530&view=diff
==============================================================================
--- trunk/idp-war/src/main/webapp/WEB-INF/jsp/login.jsp (original)
+++ trunk/idp-war/src/main/webapp/WEB-INF/jsp/login.jsp Mon Sep 15 20:20:54 2014
@@ -6,6 +6,7 @@
 <%@ page import="net.shibboleth.idp.authn.context.AuthenticationContext" %>
 <%@ page import="net.shibboleth.idp.authn.context.AuthenticationErrorContext" %>
 <%@ page import="net.shibboleth.idp.authn.context.UsernamePasswordContext" %>
+<%@ page import="net.shibboleth.idp.profile.context.RelyingPartyContext" %>
 <%@ page import="net.shibboleth.idp.ui.context.RelyingPartyUIContext" %>
 <%@ page import="org.springframework.webflow.execution.RequestContext" %>
 
@@ -16,7 +17,10 @@
 	username = "";
 }
 
-final boolean identifiedRP = ((RelyingPartyUIContext) request.getAttribute("rpUIContext")).getServiceName() != null;
+final RelyingPartyContext rpContext = (RelyingPartyContext)
+    ((ProfileRequestContext) request.getAttribute("profileRequestContext")).getSubcontext(RelyingPartyContext.class);
+final RelyingPartyUIContext rpUIContext = (RelyingPartyUIContext) request.getAttribute("rpUIContext");
+final boolean identifiedRP = !rpContext.getRelyingPartyId().contains(rpUIContext.getServiceName());
 %>
 
 <html>
@@ -65,13 +69,13 @@
               <% } %>
 
               <section>
-                <Label for="username">Username</label>
+                <Label for="j_username">Username</label>
                 <input class="form-element form-field" name="j_username" type="text"
                 	value="<%= HTMLEncoder.encodeForHTML(username) %>">
               </section>
 
               <section>
-                <label for="password">Password</label>
+                <label for="j_password">Password</label>
                 <input class="form-element form-field" name="j_password" type="password" value="">
               </section>
 


[... 18 lines stripped ...]


More information about the commits mailing list