mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Adds optional HTTP Basic Authentication to Robust service connectors.
This commit is contained in:
33
OpenSim/Services/Connectors/BaseServiceConnector.cs
Normal file
33
OpenSim/Services/Connectors/BaseServiceConnector.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.ServiceAuth;
|
||||
|
||||
using Nini.Config;
|
||||
|
||||
namespace OpenSim.Services.Connectors
|
||||
{
|
||||
public class BaseServiceConnector
|
||||
{
|
||||
protected IServiceAuth m_Auth;
|
||||
|
||||
public BaseServiceConnector() { }
|
||||
|
||||
public BaseServiceConnector(IConfigSource config, string section)
|
||||
{
|
||||
Initialise(config, section);
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource config, string section)
|
||||
{
|
||||
string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", section }, "None");
|
||||
|
||||
switch (authType)
|
||||
{
|
||||
case "BasicHttpAuthentication":
|
||||
m_Auth = new BasicHttpAuthentication(config, section);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user