Source for file AuthNTokens.abstract.php

Documentation is available at AuthNTokens.abstract.php

  1. <?php
  2. /**
  3. * @package harmoni.osid_v2.agentmanagement.authn_methods
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: AuthNTokens.abstract.php,v 1.4 2007/09/04 20:25:37 adamfranco Exp $
  9. */
  10.  
  11. /**
  12. * AuthNTokens are used by AuthNMethods as an abstraction to allow for accessing
  13. * common data from tokens passed that correspond to multiple Authorization
  14. * systems. The identifier is often a username, but can be any string as long as
  15. * it is unique within a given AuthNMethod.
  16. *
  17. * AuthNMethods deal with two types of tokens. The first are arbitrary data that
  18. * is passed by the user trying to authenticate. This data may be an array with
  19. * elements for 'username' and 'password', it might be a string operated on by a
  20. * private key, it might be a Kerberos Ticket, or pretty much anything else. It is
  21. * up to a given AuthNMethod to pass the tokens passed to it to appropriate
  22. * AuthNTokens objects for the handling of this data. AuthNTokens objects provide
  23. * access to a string 'identifier' for given tokens data that can be used by
  24. * other systems to identify this set of tokens. Additionally, the AuthNTokens
  25. * objects can be initialized with an identifier and then passed to the authentication
  26. * method for querying on the existance or associated properties of the user
  27. * that corresponds to the identifier.
  28. *
  29. * @package harmoni.osid_v2.agentmanagement.authn_methods
  30. *
  31. * @copyright Copyright &copy; 2005, Middlebury College
  32. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  33. *
  34. * @version $Id: AuthNTokens.abstract.php,v 1.4 2007/09/04 20:25:37 adamfranco Exp $
  35. */
  36. class AuthNTokens {
  37.  
  38. /**
  39. * Constructor. Stores the configuration.
  40. *
  41. * @param object Properties $configuration
  42. * @return object
  43. * @access public
  44. * @since 3/1/05
  45. */
  46. function AuthNTokens ( $configuration ) {
  47. $this->_configuration =$configuration;
  48. }
  49. /**
  50. * Initialize this object for a set of authentication tokens.
  51. *
  52. * @param mixed $tokens
  53. * @return void
  54. * @access public
  55. * @since 3/1/05
  56. */
  57. function initializeForTokens ( $tokens ) {
  58. throwError( new Error("AuthNTokens::initializeForTokens() should have been overridden in a child class.",
  59. "AuthNTokens", true));
  60. }
  61. /**
  62. * Initialize this object for an identifier. The identifier is often a
  63. * username, but can be any string as long as it is unique within a given
  64. * AuthNMethod.
  65. *
  66. * @param string $identifier
  67. * @return void
  68. * @access public
  69. * @since 3/1/05
  70. */
  71. function initializeForIdentifier ( $identifier ) {
  72. throwError( new Error("AuthNTokens::initializeForIdentifier() should have been overridden in a child class.",
  73. "AuthNTokens", true));
  74. }
  75. /**
  76. * Return the identifier string for this instance.
  77. *
  78. * @return string
  79. * @access public
  80. * @since 3/1/05
  81. */
  82. function getIdentifier () {
  83. return $this->_identifier;
  84. }
  85. /**
  86. * Return properly formatted tokens for this instance.
  87. *
  88. * @return mixed
  89. * @access public
  90. * @since 3/1/05
  91. */
  92. function getTokens () {
  93. return $this->_tokens();
  94. }
  95. }
  96.  
  97. ?>

Documentation generated on Wed, 19 Sep 2007 10:21:36 -0400 by phpDocumentor 1.3.0RC3