From 67f803c919324f49e21279faa43c9578b625529e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 4 Sep 2009 08:10:05 +0100 Subject: [PATCH] Add the new AuthStore to migrations. Update OpenSim.Server.ini --- OpenSim/Data/MySQL/MySQLAuthenticationData.cs | 3 +++ .../Data/MySQL/Resources/001_AuthStore.sql | 21 +++++++++++++++++++ .../AuthenticationServiceBase.cs | 2 +- bin/OpenSim.Server.ini.example | 15 +++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 OpenSim/Data/MySQL/Resources/001_AuthStore.sql diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs index 1ee64cec0e..afd59bd141 100644 --- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs +++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs @@ -45,6 +45,9 @@ namespace OpenSim.Data.MySQL : base(connectionString) { m_Realm = realm; + + Migration m = new Migration(m_Connection, GetType().Assembly, "AuthStore"); + m.Update(); } public AuthenticationData Get(UUID principalID) diff --git a/OpenSim/Data/MySQL/Resources/001_AuthStore.sql b/OpenSim/Data/MySQL/Resources/001_AuthStore.sql new file mode 100644 index 0000000000..c7e16fbdfb --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/001_AuthStore.sql @@ -0,0 +1,21 @@ +begin; + +CREATE TABLE `auth` ( + `UUID` char(36) NOT NULL, + `passwordHash` char(32) NOT NULL default '', + `passwordSalt` char(32) NOT NULL default '', + `webLoginKey` varchar(255) NOT NULL default '', + PRIMARY KEY (`UUID`) +) ENGINE=InnoDB; + +CREATE TABLE `tokens` ( + `UUID` char(36) NOT NULL, + `token` varchar(255) NOT NULL, + `validity` datetime NOT NULL, + UNIQUE KEY `uuid_token` (`UUID`,`token`), + KEY `UUID` (`UUID`), + KEY `token` (`token`), + KEY `validity` (`validity`) +) ENGINE=InnoDB; + +commit; diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs index 5056db3f93..2ed177ccb6 100644 --- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs +++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs @@ -53,7 +53,7 @@ namespace OpenSim.Services.AuthenticationService { string dllName = String.Empty; string connString = String.Empty; - string realm = String.Empty; + string realm = "auth"; // // Try reading the [AuthenticationService] section first, if it exists diff --git a/bin/OpenSim.Server.ini.example b/bin/OpenSim.Server.ini.example index aab056698a..545d6ce179 100644 --- a/bin/OpenSim.Server.ini.example +++ b/bin/OpenSim.Server.ini.example @@ -5,6 +5,9 @@ ; * These are the IN connectors the server uses, the in connectors ; * read this config file and load the needed OUT and database connectors ; * +; * Add "OpenSim.Server.Handlers.dll:AuthenticationServiceConnector" to +; * enable the experimental authentication service +; * [Startup] ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.Server.Handlers.dll:InventoryServiceInConnector,OpenSim.Server.Handlers.dll:FreeswitchServerConnector" @@ -45,3 +48,15 @@ ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=gr ; * This is the configuration for the freeswitch server in grid mode [FreeswitchService] LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService" + +; * This is the new style authentication service. Currently, only MySQL +; * is implemented. "Realm" is the table that is used for user lookup. +; * By setting it to "users", you can use the old style users table +; * as an authentication source. +; * +[AuthenticationService] +AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" +StorageProvider = "OpenSim.Data.MySQL.dll" +ConnectionString = "Data Source=localhost;Database=grid;User ID=grid;Password=grid;" +; Realm = "auth" +