Net::OpenID::ClaimedIdentity.3pm

Langue: en

Autres versions - même langue

Version: 2006-05-30 (ubuntu - 08/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Net::OpenID::ClaimedIdentity - a not-yet-verified OpenID identity

SYNOPSIS

   use Net::OpenID::Consumer;
   my $csr = Net::OpenID::Consumer->new;
   ....
   my $cident = $csr->claimed_identity("bradfitz.com")
     or die $csr->err;
 
   if ($AJAX_mode) {
     my $url = $cident->claimed_url;
     my $openid_server = $cident->identity_server;
     # ... return JSON with those to user agent (whose request was
     # XMLHttpRequest, probably)
   }
 
   if ($CLASSIC_mode) {
     my $check_url = $cident->check_url(
       delayed_return => 1,
       return_to      => "http://example.com/get-identity.app",
       trust_root     => "http://*.example.com/",
     );
     WebApp::redirect($check_url);
   }
 
 

DESCRIPTION

After Net::OpenID::Consumer crawls a user's declared identity URL and finds openid.server link tags in the HTML head, you get this object. It represents an identity that can be verified with OpenID (the link tags are present), but hasn't been actually verified yet.

METHODS

$url = $cident->claimed_url
The URL, now canonicalized, that the user claims to own. You can't know whether or not they do own it yet until you send them off to the check_url, though.
$id_server = $cident->identity_server
Returns the identity server that will assert whether or not this claimed identity is valid, and sign a message saying so.
$url = $cident->check_url( %opts )
Makes the URL that you have to somehow send the user to in order to validate their identity. The options to put in %opts are:
"return_to"
The URL that the identity server should redirect the user with either a verified identity signature -or- a user_setup_url (if the assertion couldn't be made). This URL may contain query parameters, and the identity server must preserve them.
"trust_root"
The URL that you want the user to actually see and declare trust for. Your "return_to" URL must be at or below your trust_root. Sending the trust_root is optional, and defaults to your "return_to" value, but it's highly recommended (and prettier for users) to see a simple trust_root. Note that the trust root may contain a wildcard at the beginning of the host, like "http://*.example.com/"
"delayed_return"
If set to a true value, the check_url returned will indicate to the user's identity server that it has permission to control the user's user-agent for awhile, giving them real pages (not just redirects) and lets them bounce around the identity server site for awhile until the requested assertion can be made, and they can finally be redirected back to your return_to URL above.

The default value, false, means that the identity server will immediately return to your return_to URL with either a ``yes'' or ``no'' answer. In the ``no'' case, you'll instead have control of what to do, and you'll be sent the identity server's user_setup_url where you'll have to somehow send the user (be it link, redirect, or pop-up window).

When writing a dynamic ``AJAX''-style application, you can't use delayed_return because the remote site can't usefully take control of a 1x1 pixel hidden IFRAME, so you'll need to get the user_setup_url and present it to the user somehow.

COPYRIGHT, WARRANTY, AUTHOR

See Net::OpenID::Consumer for author, copyrignt and licensing information.

SEE ALSO

Net::OpenID::Consumer

Net::OpenID::VerifiedIdentity

Net::OpenID::Server

Website: <http://www.danga.com/openid/>