changeset 6188:733c32da04b8

Extend the shared interface User with the SAML ticket so that it can be communicated to the GWT client. Part of flys/issue1265
author Bernhard Herzog <bh@intevation.de>
date Tue, 04 Jun 2013 17:20:50 +0200
parents 7bc35bbd8b27
children 4365320750bb
files gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java
diffstat 3 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java	Tue Jun 04 17:13:50 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java	Tue Jun 04 17:20:50 2013 +0200
@@ -60,7 +60,8 @@
                 String name = user.getAttributeNS(
                         ArtifactNamespaceContext.NAMESPACE_URI, "name");
 
-                return new DefaultUser(uuid, name);
+                return new DefaultUser(uuid, name,
+                                       loginuser.getSamlXMLBase64());
             }
         }
         catch (ConnectionException ce) {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java	Tue Jun 04 17:13:50 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java	Tue Jun 04 17:20:50 2013 +0200
@@ -22,6 +22,8 @@
     /** The name of the user.*/
     protected String name;
 
+    /** The saml ticket used for single sign-on.*/
+    protected String samlXML;
 
     /**
      * The default constructor.
@@ -36,9 +38,10 @@
      * @param identifier The uuid of the user.
      * @param name The name of the user.
      */
-    public DefaultUser(String identifier, String name) {
+    public DefaultUser(String identifier, String name, String samlXML) {
         this.identifier = identifier;
         this.name       = name;
+        this.samlXML    = samlXML;
     }
 
 
@@ -63,6 +66,16 @@
 
 
     /**
+     * Returns the SAML ticket for single sign-on.
+     *
+     * @return the SAML ticket as base64 encoded XML
+     */
+    public String getSamlXMLBase64() {
+        return samlXML;
+    }
+
+
+    /**
      * Set the identifier of the user.
      *
      * @param identifier The new identifier.
@@ -80,5 +93,14 @@
     public void setName(String name) {
         this.name = name;
     }
+
+    /**
+     * Set the SAML Ticket for single sign-on.
+     *
+     * @param samlXML the SAML ticket as base64 encoded XML.
+     */
+    public void setSamlXMLBase64(String samlXML) {
+        this.samlXML = samlXML;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java	Tue Jun 04 17:13:50 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java	Tue Jun 04 17:20:50 2013 +0200
@@ -17,8 +17,12 @@
 
     String getName();
 
+    String getSamlXMLBase64();
+
     void setName(String name);
 
     void setIdentifier(String identifier);
+
+    void setSamlXMLBase64(String samlXml);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org