Frederic G. MARAND 9 years ago
parent
commit
3bdd221685

+ 1 - 0
.jshintrc

@@ -142,6 +142,7 @@
       "validatePost": true,
 
       "PushFeed": true,
+      "SSO": true,
 
       // - Fictive global just for the last comma
       "xyzzy": false

+ 1 - 0
.meteor/packages

@@ -14,3 +14,4 @@ accounts-password
 audit-argument-checks
 fgm:errors
 webapp
+http

+ 1 - 1
client/templates/includes/header.html

@@ -17,7 +17,7 @@
           {{/if}}
       </ul>
       <ul class="nav navbar-nav navbar-right">
-        <li><a href="http://drop8/">Session: {{ drupalSessionCookie }}</a></li>
+        <li><a href="{{ authBaseUrl }}/whoami">Session: {{ drupalSessionCookie }}</a></li>
         {{> loginButtons}}
       </ul>
     </div>

+ 7 - 0
client/templates/includes/header.js

@@ -20,5 +20,12 @@ Template.header.helpers({
     });
 
     return result;
+  },
+  authBaseUrl: function () {
+    Meteor.call('userInfo', function (err, res) {
+      Meteor._debug("in header helper authBaseUrl", res);
+      Session.set("authBaseUrl", res);
+    });
+    return Session.get("authBaseUrl");
   }
 });

+ 29 - 0
server/config.js

@@ -0,0 +1,29 @@
+/**
+ * @file
+ * Server-side configuration for the application.
+ *
+ * User: marand
+ * Date: 09/09/15
+ * Time: 14:16
+ */
+
+SSO = {
+  settings: {
+    "authBaseUrl": "http://drop8"
+  },
+  configuration: {
+  },
+  state: {
+  }
+};
+
+Meteor.methods({
+  'userInfo': function () {
+    return HTTP.call('GET', SSO.settings.authBaseUrl + '/', {
+      params: {},
+      headers: {
+        'cookie': 'SESS2767e46e15422527777376ba0aeecd4b=' + 'LaMN_H0qgYhkBoLY7RQMFHDr9QWUVBJWez-OcnaOGGo'
+      }
+    });
+  }
+});

+ 1 - 0
server/publications.js

@@ -27,3 +27,4 @@ Meteor.publish('userData', function () {
     });
   }
 });
+