示例#1
0
 public function testBuildDocument()
 {
     $services = array();
     array_push($services, new XRDSService(0, "http://specs.openid.net/auth/2.0/server", "https://dev.openstackid.com", array("http://openid.net/srv/ax/1.0", "http://specs.openid.net/extensions/pape/1.0")));
     $builder = new XRDSDocumentBuilder($services);
     $xrds = $builder->render();
     $this->assertTrue(!empty($xrds) && str_contains($xrds, "http://specs.openid.net/auth/2.0/server") && str_contains($xrds, "http://openid.net/srv/ax/1.0") && str_contains($xrds, "http://specs.openid.net/extensions/pape/1.0"));
 }
示例#2
0
 public function getXRDSDiscovery($mode, $canonical_id = null)
 {
     $active_extensions = $this->server_extension_service->getAllActiveExtensions();
     $extensions = array();
     foreach ($active_extensions as $ext) {
         array_push($extensions, $ext->getNamespace());
     }
     $services = array();
     array_push($services, new XRDSService(0, $mode == IOpenIdProtocol::OpenIdXRDSModeUser ? self::ClaimedIdentifierType : self::OPIdentifierType, $this->server_config_service->getOPEndpointURL(), $extensions, $canonical_id));
     $builder = new XRDSDocumentBuilder($services, $canonical_id);
     $xrds = $builder->render();
     return $xrds;
 }