idpXrds.php 611 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. require_once "lib/session.php";
  3. require_once "lib/render.php";
  4. require_once "Auth/OpenID/Discover.php";
  5. define('idp_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?>
  6. <xrds:XRDS
  7. xmlns:xrds="xri://$xrds"
  8. xmlns="xri://$xrd*($v*2.0)">
  9. <XRD>
  10. <Service priority="0">
  11. <Type>%s</Type>
  12. <URI>%s</URI>
  13. </Service>
  14. </XRD>
  15. </xrds:XRDS>
  16. ');
  17. function idpXrds_render()
  18. {
  19. $headers = array('Content-type: application/xrds+xml');
  20. $body = sprintf(idp_xrds_pat,
  21. Auth_OpenID_TYPE_2_0_IDP,
  22. buildURL());
  23. return array($headers, $body);
  24. }
  25. ?>