GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::OPENID::YADIS (3)

.ds Aq ’

NAME

Net::OpenID::Yadis - Perform Yadis discovery on URLs

CONTENTS

VERSION

version 1.20

SYNOPSIS



  use Net::OpenID::Yadis;

  my $disc = Net::OpenID::Yadis->new(
      consumer => $consumer, # Net::OpenID::Consumer object
  );

  my $xrd = $disc->discover("http://id.example.com/") or Carp::croak($disc->err);

  print $disc->identity_url;       # Yadis URL (Final URL if redirected)
  print $disc->xrd_url;            # Yadis Resourse Descriptor URL

  foreach my $srv (@$xrd) {        # Loop for Each Service in Yadis Resourse Descriptor
    print $srv->priority;          # Service priority (sorted)
    print $srv->Type;              # Identifier of some version of some service (scalar, array or array ref)
    print $srv->URI;               # URI that resolves to a resource providing the service (scalar, array or array ref)
    print $srv->extra_field("Delegate","http://openid.net/xmlns/1.0");
                                   # Extra field of some service
  }

  # If you are interested only in OpenID. (either 1.1 or 2.0)
  my $xrd = $self->services(
    http://specs.openid.net/auth/2.0/signon,
    http://specs.openid.net/auth/2.0/server,
    http://openid.net/signon/1.1,
  );

  # If you want to choose random server by code-ref.
  my $xrd = $self->services(sub{($_[int(rand(@_))])});



DESCRIPTION

This module provides an implementation of the Yadis protocol, which does XRDS-based service discovery on URLs.

This module was originally developed by OHTSUKA Ko-hei as Net::Yadis::Discovery, but was forked and simplified for inclusion in the core OpenID Consumer package.

This simplified version is tailored for the needs of Net::OpenID::Consumer; for other uses, Net::Yadis::Discovery is probably a better choice.

CONSTRUCTOR

new my $disc = Net::OpenID::Yadis->new([ %opts ]);

You can set the consumer in the constructor. See the corresponding method description below.

EXPORT

This module exports three constant values to use with discover method.
YR_GET If you set this, module check Yadis URL start from HTTP GET request. This is the default.
YR_XRDS If you set this, this module consider Yadis URL as Yadis Resource Descriptor URL. If not so, an error is returned.

METHODS

$disc-><B>consumerB>($consumer)
$disc-><B>consumerB> Get or set the Net::OpenID::Consumer object that this object is associated with.
$disc-><B>discoverB>($url,[$request_method]) Given a user-entered $url (which could be missing http://, or have extra whitespace, etc), returns either array/array ref of Net::OpenID::Yadis::Service objects, or undef on failure.

$request_method is optional, and if set this, you can change the HTTP request method of fetching Yadis URL. See EXPORT to know the value you can set, and default is YR_HEAD.

If this method returns undef, you can rely on the following errors codes (from $csr-><B>errcodeB>) to decide what to present to the user:
xrd_parse_error
xrd_format_error
too_many_hops
no_yadis_document
url_fetch_err
empty_url
url_gone

$disc-><B>xrd_objectsB> Returns array/array ref of Net::OpenID::Yadis objects. It is same what could be got by discover method.
$disc-><B>identity_urlB> Returns Yadis URL. If not redirected, it is same with the argument of discover method.
$disc-><B>xrd_urlB> Returns Yadis Resource Descriptor URL.
$disc-><B>serversB>($protocol,$protocol,...)
$disc-><B>serversB>($protocol=>[$version1,$version2],...)
$disc-><B>serversB>($protocol,....,$code_ref); Filter method of xrd_objects.

If no option is defined, returns same result with xrd_objects method.

protocol names or Type URLs are given, filter only given protocol. Two or more protocols are given, return and results of filtering.

Sample:
$disc->servers(openid,http://lid.netmesh.org/sso/1.0);

If reference of version numbers array is given after protocol names, filter only given version of protocol.

Sample:
$disc->servers(openid=>[’1.0’,’1.1’],lid=>[’1.0’]);

If you want to use version numbers limitation with type URL, you can use \ver as place holder of version number.

Sample:
$disc->servers(http://lid.netmesh.org/sso/\ver=>[’1.0’,’2.0’]);

If code reference is given as argument , you can make your own filter rule. code reference is executed at the last of filtering logic, like this:



  @results = $code_ref->(@temporary_results)



Sample: If you want to filter OpenID server and get only first one:
($openid_server) = $disc->servers(openid,sub{$_[0]});

$disc-><B>errB> Returns the last error, in form errcode: errtext
$disc-><B>errcodeB> Returns the last error code.
$disc-><B>errtextB> Returns the last error text.

COPYRIGHT

This module is Copyright (c) 2006 OHTSUKA Ko-hei. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

WARRANTY

This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.

SEE ALSO

Yadis website: <http://yadis.org/>

Net::OpenID::Yadis::Service

Net::OpenID::Consumer

AUTHORS

Based on Net::Yadis::Discovery by OHTSUKA Ko-hei <nene@kokogiko.net>

Martin Atkins <mart@degeneration.co.uk>

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::OPENID::YADIS (3) 2016-02-08

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.