aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Authentication
diff options
context:
space:
mode:
authorDiva Canto2014-05-23 16:19:43 -0700
committerDiva Canto2014-05-23 16:19:43 -0700
commit20f20895cf1444071d5edc42e11a1fb94b1b1079 (patch)
tree0c7547590a89eec47886e0a8646f86ebbf449e63 /OpenSim/Server/Handlers/Authentication
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.zip
opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.gz
opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.bz2
opensim-SC-20f20895cf1444071d5edc42e11a1fb94b1b1079.tar.xz
Adds optional HTTP Basic Authentication to Robust service connectors.
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs8
2 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
index 848a037..c9a8dce 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerConnector.cs
@@ -29,6 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.ServiceAuth;
32using OpenSim.Framework.Servers.HttpServer; 33using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
@@ -58,7 +59,9 @@ namespace OpenSim.Server.Handlers.Authentication
58 Object[] args = new Object[] { config }; 59 Object[] args = new Object[] { config };
59 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authenticationService, args); 60 m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authenticationService, args);
60 61
61 server.AddStreamHandler(new AuthenticationServerPostHandler(m_AuthenticationService, serverConfig)); 62 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
63
64 server.AddStreamHandler(new AuthenticationServerPostHandler(m_AuthenticationService, serverConfig, auth));
62 } 65 }
63 } 66 }
64} 67}
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index 16e011a..e258dde 100644
--- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
@@ -39,6 +39,7 @@ using System.Collections.Generic;
39using OpenSim.Server.Base; 39using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.ServiceAuth;
42using OpenSim.Framework.Servers.HttpServer; 43using OpenSim.Framework.Servers.HttpServer;
43using OpenMetaverse; 44using OpenMetaverse;
44 45
@@ -55,10 +56,10 @@ namespace OpenSim.Server.Handlers.Authentication
55 private bool m_AllowSetPassword = false; 56 private bool m_AllowSetPassword = false;
56 57
57 public AuthenticationServerPostHandler(IAuthenticationService service) : 58 public AuthenticationServerPostHandler(IAuthenticationService service) :
58 this(service, null) {} 59 this(service, null, null) {}
59 60
60 public AuthenticationServerPostHandler(IAuthenticationService service, IConfig config) : 61 public AuthenticationServerPostHandler(IAuthenticationService service, IConfig config, IServiceAuth auth) :
61 base("POST", "/auth") 62 base("POST", "/auth", auth)
62 { 63 {
63 m_AuthenticationService = service; 64 m_AuthenticationService = service;
64 65
@@ -73,6 +74,7 @@ namespace OpenSim.Server.Handlers.Authentication
73 protected override byte[] ProcessRequest(string path, Stream request, 74 protected override byte[] ProcessRequest(string path, Stream request,
74 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 75 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
75 { 76 {
77 m_log.Error("[XXX]: Authenticating...");
76 string[] p = SplitParams(path); 78 string[] p = SplitParams(path);
77 79
78 if (p.Length > 0) 80 if (p.Length > 0)