PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/src/application/libraries/Zend/Service/DeveloperGarden/Response/SecurityTokenServer/SecurityTokenResponse.php

https://bitbucket.org/masnug/grc276-blog-laravel
PHP | 116 lines | 34 code | 10 blank | 72 comment | 2 complexity | 6d99f76f826333f35e8bd962b3f49f61 MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Service
  17. * @subpackage DeveloperGarden
  18. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: SecurityTokenResponse.php 23775 2011-03-01 17:25:24Z ralph $
  21. */
  22. /**
  23. * @see Zend_Service_DeveloperGarden_Response_ResponseAbstract
  24. */
  25. require_once 'Zend/Service/DeveloperGarden/Response/ResponseAbstract.php';
  26. /**
  27. * @see Zend_Service_DeveloperGarden_Response_SecurityTokenServer_Interface
  28. */
  29. require_once 'Zend/Service/DeveloperGarden/Response/SecurityTokenServer/Interface.php';
  30. /**
  31. * @category Zend
  32. * @package Zend_Service
  33. * @subpackage DeveloperGarden
  34. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @author Marco Kaiser
  36. * @license http://framework.zend.com/license/new-bsd New BSD License
  37. */
  38. class Zend_Service_DeveloperGarden_Response_SecurityTokenServer_SecurityTokenResponse
  39. extends Zend_Service_DeveloperGarden_Response_ResponseAbstract
  40. implements Zend_Service_DeveloperGarden_Response_SecurityTokenServer_Interface
  41. {
  42. /**
  43. * the token format, should be saml20
  44. *
  45. * @var string
  46. */
  47. public $tokenFormat = null;
  48. /**
  49. * the token encoding, should be text/xml
  50. *
  51. * @var string
  52. */
  53. public $tokenEncoding = null;
  54. /**
  55. * the tokenData should be a valid Assertion value
  56. *
  57. * @var unknown_type
  58. */
  59. public $tokenData = null;
  60. /**
  61. * returns the tokenData
  62. *
  63. * @return string
  64. */
  65. public function getTokenData()
  66. {
  67. if (empty($this->tokenData)) {
  68. require_once 'Zend/Service/DeveloperGarden/Response/Exception.php';
  69. throw new Zend_Service_DeveloperGarden_Response_Exception('No valid tokenData found.');
  70. }
  71. return $this->tokenData;
  72. }
  73. /**
  74. * returns the token format value
  75. *
  76. * @return string
  77. */
  78. public function getTokenFormat()
  79. {
  80. return $this->tokenFormat;
  81. }
  82. /**
  83. * returns the token encoding
  84. *
  85. * @return string
  86. */
  87. public function getTokenEncoding()
  88. {
  89. return $this->tokenEncoding;
  90. }
  91. /**
  92. * returns true if the stored token data is valid
  93. *
  94. * @return boolean
  95. */
  96. public function isValid()
  97. {
  98. /**
  99. * @todo implement the true token validation check
  100. */
  101. if (!empty($this->securityTokenData)) {
  102. return true;
  103. }
  104. return false;
  105. }
  106. }