1
0

IAuthenticationService.cs 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using OpenMetaverse;
  29. namespace OpenSim.Services.Interfaces
  30. {
  31. // Generic Authentication service used for identifying
  32. // and authenticating principals.
  33. // Principals may be clients acting on users' behalf,
  34. // or any other components that need
  35. // verifiable identification.
  36. //
  37. public interface IAuthenticationService
  38. {
  39. //////////////////////////////////////////////////////
  40. // Authentication
  41. //
  42. // These methods will return a token, which can be used to access
  43. // various services.
  44. //
  45. string Authenticate(UUID principalID, string password, int lifetime);
  46. //////////////////////////////////////////////////////
  47. // Verification
  48. //
  49. // Allows to verify the authenticity of a token
  50. //
  51. // Tokens expire after 30 minutes and can be refreshed by
  52. // re-verifying.
  53. //
  54. bool Verify(UUID principalID, string token, int lifetime);
  55. //////////////////////////////////////////////////////
  56. // Teardown
  57. //
  58. // A token can be returned before the timeout. This
  59. // invalidates it and it can not subsequently be used
  60. // or refreshed.
  61. //
  62. bool Release(UUID principalID, string token);
  63. //////////////////////////////////////////////////////
  64. // SetPassword for a principal
  65. //
  66. // This method exists for the service, but may or may not
  67. // be served remotely. That is, the authentication
  68. // handlers may not include one handler for this,
  69. // because it's a bit risky. Such handlers require
  70. // authentication/authorization.
  71. //
  72. bool SetPassword(UUID principalID, string passwd);
  73. //////////////////////////////////////////////////////
  74. // Grid
  75. //
  76. // We no longer need a shared secret between grid
  77. // servers. Anything a server requests from another
  78. // server is either done on behalf of a user, in which
  79. // case there is a token, or on behalf of a region,
  80. // which has a session. So, no more keys.
  81. // If sniffing on the local lan is an issue, admins
  82. // need to take approriate action (IPSec is recommended)
  83. // to secure inter-server traffic.
  84. //////////////////////////////////////////////////////
  85. // NOTE
  86. //
  87. // Session IDs are not handled here. After obtaining
  88. // a token, the session ID regions use can be
  89. // obtained from the presence service.
  90. }
  91. }