From 858b0a2efd4790042c3e248ce895a426462a2576 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 30 Jun 2009 21:48:03 +0000 Subject: Updated services to allow external applications like web interfaces to authenticate against the services. This paves the way for such apps to directly talk to services. --- .../Services/Interfaces/IAuthenticationService.cs | 42 ++++++++++++++++---- OpenSim/Services/Interfaces/IUserService.cs | 45 +++++++++++++++++++--- 2 files changed, 74 insertions(+), 13 deletions(-) (limited to 'OpenSim/Services/Interfaces') diff --git a/OpenSim/Services/Interfaces/IAuthenticationService.cs b/OpenSim/Services/Interfaces/IAuthenticationService.cs index fa45cbc..2402414 100644 --- a/OpenSim/Services/Interfaces/IAuthenticationService.cs +++ b/OpenSim/Services/Interfaces/IAuthenticationService.cs @@ -38,9 +38,9 @@ namespace OpenSim.Services.Interfaces // public interface IAuthenticationService { - // Check the pricipal's password + ////////////////////////////////////////////////// + // Web login key portion // - bool Authenticate(UUID principalID, string password); // Get a service key given that principal's // authentication token (master key). @@ -51,18 +51,44 @@ namespace OpenSim.Services.Interfaces // bool VerifyKey(UUID principalID, string key); - // Create a new user session. If one exists, it is cleared - // - UUID AllocateUserSession(UUID userID); + ////////////////////////////////////////////////// + // Password auth portion + // + + // Here's how thos works, and why. + // + // The authentication methods will return the existing session, + // or UUID.Zero if authentication failed. If there is no session, + // they will create one. + // The CreateUserSession method will unconditionally create a session + // and invalidate the prior session. + // Grid login uses this method to make sure that the session is + // fresh and new. Other software, like management applications, + // can obtain this existing session if they have a key or password + // for that account, this allows external apps to obtain credentials + // and use authenticating interface methods. + // + + // Check the pricipal's password + // + UUID AuthenticatePassword(UUID principalID, string password); + + // Check the principal's key + // + UUID AuthenticateKey(UUID principalID, string password); + + // Create a new session, invalidating the old ones + // + UUID CreateUserSession(UUID principalID, UUID oldSessionID); // Verify that a user session ID is valid. A session ID is // considered valid when a user has successfully authenticated // at least one time inside that session. // - bool VerifyUserSession(UUID principalID, UUID session); + bool VerifyUserSession(UUID principalID, UUID sessionID); - // Remove a user session identifier and deauthenticate the user + // Deauthenticate user // - void DestroyUserSession(UUID principalID); + bool DestroyUserSession(UUID principalID, UUID sessionID); } } diff --git a/OpenSim/Services/Interfaces/IUserService.cs b/OpenSim/Services/Interfaces/IUserService.cs index 2a4e79d..9bbe503 100644 --- a/OpenSim/Services/Interfaces/IUserService.cs +++ b/OpenSim/Services/Interfaces/IUserService.cs @@ -32,6 +32,24 @@ namespace OpenSim.Services.Interfaces { public class UserData { + public UserData() + { + } + + public UserData(UUID userID, UUID homeRegionID, float homePositionX, + float homePositionY, float homePositionZ, float homeLookAtX, + float homeLookAtY, float homeLookAtZ) + { + UserID = userID; + HomeRegionID = homeRegionID; + HomePositionX = homePositionX; + HomePositionY = homePositionY; + HomePositionZ = homePositionZ; + HomeLookAtX = homeLookAtX; + HomeLookAtY = homeLookAtY; + HomeLookAtZ = homeLookAtZ; + } + public string FirstName; public string LastName; public UUID UserID; @@ -49,7 +67,7 @@ namespace OpenSim.Services.Interfaces public float HomeLookAtY; public float HomeLookAtZ; - // There are here because they + // These are here because they // concern the account rather than // the profile. They just happen to // be used in the Linden profile as well @@ -58,11 +76,21 @@ namespace OpenSim.Services.Interfaces public int UserFlags; public string AccountType; - // This is only used internally. It needs to be set - // to the secret of the sending region when updating - // user data. + }; + + public class UserDataMessage + { + public UserData Data; + + // Set to the region's ID and secret when updating home location // + public UUID RegionID; public UUID RegionSecret; + + // Set to the auth info of the user requesting creation/update + // + public UUID PrincipalID; + public UUID SessionID; }; public interface IUserDataService @@ -73,11 +101,18 @@ namespace OpenSim.Services.Interfaces // This will set only the home region portion of the data! // Can't be used to set god level, flags, type or change the name! // - bool SetUserData(UserData data); + bool SetHomePosition(UserData data, UUID RegionID, UUID RegionSecret); + + // Update all updatable fields + // + bool SetUserData(UserData data, UUID PrincipalID, UUID SessionID); // Returns the list of avatars that matches both the search // criterion and the scope ID passed // List GetAvatarPickerData(UUID scopeID, string query); + + // Creates a user data record + bool CreateUserData(UserData data, UUID PrincipalID, UUID SessionID); } } -- cgit v1.1