From f6410882a5bb3ac53e7a0434c3dcc4ecd1de8457 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Sat, 19 Sep 2009 18:18:47 +0100
Subject: Finish the (untested) authentication connector

---
 .../AuthenticationServiceConnector.cs              | 37 ++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
index 258b9b1..50e817e 100644
--- a/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Authentication/AuthenticationServiceConnector.cs
@@ -106,12 +106,45 @@ namespace OpenSim.Services.Connectors
 
         public bool Verify(UUID principalID, string token, int lifetime)
         {
-            return false;
+            Dictionary<string, string> sendData = new Dictionary<string, string>();
+            sendData["LIFETIME"] = lifetime.ToString();
+            sendData["PRINCIPAL"] = principalID.ToString();
+            sendData["TOKEN"] = token;
+
+            sendData["METHOD"] = "verify";
+
+            string reply = SynchronousRestFormsRequester.MakeRequest("POST",
+                    m_ServerURI + "/auth/plain",
+                    ServerUtils.BuildQueryString(sendData));
+
+            Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
+                    reply);
+
+            if (replyData["Result"].ToString() != "Success")
+                return false;
+
+            return true;
         }
 
         public bool Release(UUID principalID, string token)
         {
-            return false;
+            Dictionary<string, string> sendData = new Dictionary<string, string>();
+            sendData["PRINCIPAL"] = principalID.ToString();
+            sendData["TOKEN"] = token;
+
+            sendData["METHOD"] = "release";
+
+            string reply = SynchronousRestFormsRequester.MakeRequest("POST",
+                    m_ServerURI + "/auth/plain",
+                    ServerUtils.BuildQueryString(sendData));
+
+            Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
+                    reply);
+
+            if (replyData["Result"].ToString() != "Success")
+                return false;
+
+            return true;
         }
     }
 }
-- 
cgit v1.1