[Dive4elements-commits] [PATCH 2 of 8] Extend the shared interface User with the SAML ticket

Wald Commits scm-commit at wald.intevation.org
Tue Jun 4 18:45:34 CEST 2013


# HG changeset patch
# User Bernhard Herzog <bh at intevation.de>
# Date 1370359250 -7200
# Node ID 733c32da04b871148e4d856c0ce3b9eb287365d0
# Parent  7bc35bbd8b27623a4d0aa279f73aa06c62b043f5
Extend the shared interface User with the SAML ticket
so that it can be communicated to the GWT client.
Part of flys/issue1265

diff -r 7bc35bbd8b27 -r 733c32da04b8 gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java
--- 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) {
diff -r 7bc35bbd8b27 -r 733c32da04b8 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java
--- 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 :
diff -r 7bc35bbd8b27 -r 733c32da04b8 gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java
--- 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 :


More information about the Dive4elements-commits mailing list