diff options
author | Diva Canto | 2014-05-23 17:31:39 -0700 |
---|---|---|
committer | Diva Canto | 2014-05-23 17:31:39 -0700 |
commit | ff9da2446583ffd95b42e7ced2a86c2166c993c1 (patch) | |
tree | b775be9cce73a03831bd7d4c23555d844874c093 /OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-ff9da2446583ffd95b42e7ced2a86c2166c993c1.zip opensim-SC_OLD-ff9da2446583ffd95b42e7ced2a86c2166c993c1.tar.gz opensim-SC_OLD-ff9da2446583ffd95b42e7ced2a86c2166c993c1.tar.bz2 opensim-SC_OLD-ff9da2446583ffd95b42e7ced2a86c2166c993c1.tar.xz |
Added HTTP Authentication also to Groups and offline IM.
Diffstat (limited to 'OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs')
-rw-r--r-- | OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs index eb287a4..047b8be 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRemoteConnector.cs | |||
@@ -32,6 +32,7 @@ using System.Reflection; | |||
32 | using System.Text; | 32 | using System.Text; |
33 | 33 | ||
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.ServiceAuth; | ||
35 | using OpenSim.Server.Base; | 36 | using OpenSim.Server.Base; |
36 | using OpenSim.Services.Interfaces; | 37 | using OpenSim.Services.Interfaces; |
37 | 38 | ||
@@ -46,6 +47,7 @@ namespace OpenSim.OfflineIM | |||
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 48 | ||
48 | private string m_ServerURI = string.Empty; | 49 | private string m_ServerURI = string.Empty; |
50 | private IServiceAuth m_Auth; | ||
49 | private object m_Lock = new object(); | 51 | private object m_Lock = new object(); |
50 | 52 | ||
51 | public OfflineIMServiceRemoteConnector(string url) | 53 | public OfflineIMServiceRemoteConnector(string url) |
@@ -65,6 +67,18 @@ namespace OpenSim.OfflineIM | |||
65 | 67 | ||
66 | m_ServerURI = cnf.GetString("OfflineMessageURL", string.Empty); | 68 | m_ServerURI = cnf.GetString("OfflineMessageURL", string.Empty); |
67 | 69 | ||
70 | /// This is from BaseServiceConnector | ||
71 | string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", "Messaging" }, "None"); | ||
72 | |||
73 | switch (authType) | ||
74 | { | ||
75 | case "BasicHttpAuthentication": | ||
76 | m_Auth = new BasicHttpAuthentication(config, "Messaging"); | ||
77 | break; | ||
78 | } | ||
79 | /// | ||
80 | m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: Offline IM server at {0} with auth {1}", | ||
81 | m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString())); | ||
68 | } | 82 | } |
69 | 83 | ||
70 | #region IOfflineIMService | 84 | #region IOfflineIMService |
@@ -143,7 +157,8 @@ namespace OpenSim.OfflineIM | |||
143 | lock (m_Lock) | 157 | lock (m_Lock) |
144 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | 158 | reply = SynchronousRestFormsRequester.MakeRequest("POST", |
145 | m_ServerURI + "/offlineim", | 159 | m_ServerURI + "/offlineim", |
146 | ServerUtils.BuildQueryString(sendData)); | 160 | ServerUtils.BuildQueryString(sendData), |
161 | m_Auth); | ||
147 | 162 | ||
148 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( | 163 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse( |
149 | reply); | 164 | reply); |