From 7cf970fb27297d9550d4bdb1d520e9c6ff0a381d Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Tue, 21 Feb 2012 14:21:03 -0500
Subject: V3 Support:

	This starts V3 support by adding a profile server url to the login response. This requires viewer support - which is also being worked on.
---
 OpenSim/Services/LLLoginService/LLLoginResponse.cs | 20 +++++++++++++++++++-
 OpenSim/Services/LLLoginService/LLLoginService.cs  |  4 +++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index 1a874c8..b6f6d31 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -168,6 +168,9 @@ namespace OpenSim.Services.LLLoginService
         // Web map
         private string mapTileURL;
 
+        // Web Profiles
+        private string profileURL;
+
         private string searchURL;
 
         // Error Flags
@@ -220,7 +223,7 @@ namespace OpenSim.Services.LLLoginService
         public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
             GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
             string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
-            GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency)
+            GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string searchURL, string currency)
             : this()
         {
             FillOutInventoryData(invSkel, libService);
@@ -237,6 +240,8 @@ namespace OpenSim.Services.LLLoginService
             BuddList = ConvertFriendListItem(friendsList);
             StartLocation = where;
             MapTileURL = mapTileURL;
+            ProfileURL = profileURL;
+
             SearchURL = searchURL;
             Currency = currency;
 
@@ -384,6 +389,7 @@ namespace OpenSim.Services.LLLoginService
             InitialOutfitHash["gender"] = "female";
             initialOutfit.Add(InitialOutfitHash);
             mapTileURL = String.Empty;
+            profileURL = String.Empty;
             searchURL = String.Empty;
 
             currency = String.Empty;
@@ -456,6 +462,9 @@ namespace OpenSim.Services.LLLoginService
                 if (mapTileURL != String.Empty)
                     responseData["map-server-url"] = mapTileURL;
 
+                if (profileURL != String.Empty)
+                    responseData["profile-server-url"] = profileURL;
+
                 if (m_buddyList != null)
                 {
                     responseData["buddy-list"] = m_buddyList.ToArray();
@@ -561,6 +570,9 @@ namespace OpenSim.Services.LLLoginService
                 if (mapTileURL != String.Empty)
                     map["map-server-url"] = OSD.FromString(mapTileURL);
 
+                if (profileURL != String.Empty)
+                    map["profile-server-url"] = OSD.FromString(profileURL);
+
                 if (searchURL != String.Empty)
                     map["search"] = OSD.FromString(searchURL);
 
@@ -933,6 +945,12 @@ namespace OpenSim.Services.LLLoginService
             set { mapTileURL = value; }
         }
 
+        public string ProfileURL
+        {
+            get { return profileURL; }
+            set { profileURL = value; }
+        }
+
         public string SearchURL
         {
             get { return searchURL; }
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 5dff512..02e62c8 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -74,6 +74,7 @@ namespace OpenSim.Services.LLLoginService
         protected string m_GatekeeperURL;
         protected bool m_AllowRemoteSetLoginLevel;
         protected string m_MapTileURL;
+        protected string m_ProfileURL;
         protected string m_SearchURL;
         protected string m_Currency;
 
@@ -108,6 +109,7 @@ namespace OpenSim.Services.LLLoginService
             m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
             m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
             m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
+            m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty);
             m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
             m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty);
 
@@ -413,7 +415,7 @@ namespace OpenSim.Services.LLLoginService
                 // Finally, fill out the response and return it
                 //
                 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
-                    where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL, m_Currency);
+                    where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_SearchURL, m_Currency);
 
                 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
                 return response;
-- 
cgit v1.1


From 67bea681e2a75039595be9dab23ad157d123e597 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Tue, 21 Feb 2012 23:04:49 -0500
Subject: Add web profile url setting to ini

---
 bin/Robust.ini.example | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example
index 90f7b5c..91cd6d0 100644
--- a/bin/Robust.ini.example
+++ b/bin/Robust.ini.example
@@ -224,6 +224,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
     ; For V2 map
     MapTileURL = "http://127.0.0.1:8002";
 
+    ; For V2/3 Web Profiles
+    ProfileServerURL = "http://127.0.0.1/profiles/[AGENT_NAME]
+
     ; If you run this login server behind a proxy, set this to true
     ; HasProxy = false
 
-- 
cgit v1.1


From 165ae251ec132da30dc58513101e4ec438df8d2f Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Wed, 22 Feb 2012 16:36:28 -0500
Subject: V3 Support

	The V3 webapps need SSO capability and use OpenID. We need to send both our OpenID server url and a token for the user in the login response.
---
 OpenSim/Services/LLLoginService/LLLoginResponse.cs | 20 +++++++++++++++++++-
 OpenSim/Services/LLLoginService/LLLoginService.cs  |  4 +++-
 bin/Robust.ini.example                             |  3 +++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
index b6f6d31..844c5ae 100644
--- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs
@@ -171,6 +171,9 @@ namespace OpenSim.Services.LLLoginService
         // Web Profiles
         private string profileURL;
 
+        // OpenID
+        private string openIDURL;
+
         private string searchURL;
 
         // Error Flags
@@ -223,7 +226,7 @@ namespace OpenSim.Services.LLLoginService
         public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
             GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
             string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
-            GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string searchURL, string currency)
+            GridRegion home, IPEndPoint clientIP, string mapTileURL, string profileURL, string openIDURL, string searchURL, string currency)
             : this()
         {
             FillOutInventoryData(invSkel, libService);
@@ -241,6 +244,7 @@ namespace OpenSim.Services.LLLoginService
             StartLocation = where;
             MapTileURL = mapTileURL;
             ProfileURL = profileURL;
+            OpenIDURL = openIDURL;
 
             SearchURL = searchURL;
             Currency = currency;
@@ -390,6 +394,7 @@ namespace OpenSim.Services.LLLoginService
             initialOutfit.Add(InitialOutfitHash);
             mapTileURL = String.Empty;
             profileURL = String.Empty;
+            openIDURL = String.Empty;
             searchURL = String.Empty;
 
             currency = String.Empty;
@@ -465,6 +470,10 @@ namespace OpenSim.Services.LLLoginService
                 if (profileURL != String.Empty)
                     responseData["profile-server-url"] = profileURL;
 
+                // We need to send an openid_token back in the response too
+                if (openIDURL != String.Empty)
+                    responseData["openid_url"] = openIDURL;
+
                 if (m_buddyList != null)
                 {
                     responseData["buddy-list"] = m_buddyList.ToArray();
@@ -573,6 +582,9 @@ namespace OpenSim.Services.LLLoginService
                 if (profileURL != String.Empty)
                     map["profile-server-url"] = OSD.FromString(profileURL);
 
+                if (openIDURL != String.Empty)
+                    map["openid_url"] = OSD.FromString(openIDURL);
+
                 if (searchURL != String.Empty)
                     map["search"] = OSD.FromString(searchURL);
 
@@ -951,6 +963,12 @@ namespace OpenSim.Services.LLLoginService
             set { profileURL = value; }
         }
 
+        public string OpenIDURL
+        {
+            get { return openIDURL; }
+            set { openIDURL = value; }
+        }
+
         public string SearchURL
         {
             get { return searchURL; }
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 02e62c8..f7b38d4 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -75,6 +75,7 @@ namespace OpenSim.Services.LLLoginService
         protected bool m_AllowRemoteSetLoginLevel;
         protected string m_MapTileURL;
         protected string m_ProfileURL;
+        protected string m_OpenIDURL;
         protected string m_SearchURL;
         protected string m_Currency;
 
@@ -110,6 +111,7 @@ namespace OpenSim.Services.LLLoginService
             m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
             m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
             m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty);
+            m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty);
             m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
             m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty);
 
@@ -415,7 +417,7 @@ namespace OpenSim.Services.LLLoginService
                 // Finally, fill out the response and return it
                 //
                 LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
-                    where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_SearchURL, m_Currency);
+                    where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency);
 
                 m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
                 return response;
diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example
index 91cd6d0..326caeb 100644
--- a/bin/Robust.ini.example
+++ b/bin/Robust.ini.example
@@ -227,6 +227,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
     ; For V2/3 Web Profiles
     ProfileServerURL = "http://127.0.0.1/profiles/[AGENT_NAME]
 
+    ; For V2/V3 webapp authentication SSO
+    OpenIDServerURL = "http://127.0.0.1/openid/openidserver/
+
     ; If you run this login server behind a proxy, set this to true
     ; HasProxy = false
 
-- 
cgit v1.1


From d242d47e5cf1274225091e843e065366a3620c14 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Fri, 2 Mar 2012 15:05:06 -0500
Subject: OpenID auth needs hashing before authenticating

---
 OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs           | 2 +-
 OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
index 440b898..dfed761 100644
--- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs
@@ -248,7 +248,7 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>.
                             if (passwordValues != null && passwordValues.Length == 1)
                             {
                                 if (account != null && 
-                                    (m_authenticationService.Authenticate(account.PrincipalID, passwordValues[0], 30) != string.Empty))
+                                    (m_authenticationService.Authenticate(account.PrincipalID,Util.Md5Hash(passwordValues[0]), 30) != string.Empty))
                                     authRequest.IsAuthenticated = true;
                                 else
                                     authRequest.IsAuthenticated = false;
diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
index 48eb3f8..5f1bde1 100644
--- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
+++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
@@ -80,7 +80,7 @@ namespace OpenSim.Services.AuthenticationService
             {
                 string hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString());
 
-                //m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
+                m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
 
                 if (data.Data["passwordHash"].ToString() == hashed)
                 {
-- 
cgit v1.1


From 98ad6ed255e1b1e55b58c633263480fb12ed3f7a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 2 Mar 2012 23:29:35 +0000
Subject: comment out "[CAPS]: ScriptTaskInventory Request" log spam

---
 OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index be699db..35cb575 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -262,7 +262,7 @@ namespace OpenSim.Region.ClientStack.Linden
         {
             try
             {
-                m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
+//                m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
                 //m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param);
 
                 Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
-- 
cgit v1.1


From ac934e2dbb57f9ba42ed1b2405e294c802f05616 Mon Sep 17 00:00:00 2001
From: BlueWall
Date: Sun, 4 Mar 2012 11:11:01 -0500
Subject: Add WebProfiles config to other config example

---
 bin/Robust.HG.ini.example | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index ab5880d..db9f08b 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -241,6 +241,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
     ; For V2 map
     MapTileURL = "http://127.0.0.1:8002";
 
+    ; For WebProfiles (V3)
+    ProfileServerURL = "http://127.0.0.1/profiles/[AGENT_NAME]"
+
     ; If you run this login server behind a proxy, set this to true
     ; HasProxy = false
     
-- 
cgit v1.1