Net::OpenID::ClaimedIdentity(3pm) | User Contributed Perl Documentation | Net::OpenID::ClaimedIdentity(3pm) |
Net::OpenID::ClaimedIdentity - A not-yet-verified OpenID identity
version 1.18
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); }
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.
$cident->set_extension_args( 'http://openid.net/extensions/sreg/1.1', { required => 'email', optional => 'fullname,nickname', policy_url => 'http://example.com/privacypolicy.html', }, );
Note that when making an OpenID 1.1 request, only the Simple Registration extension is supported. There was no general extension mechanism defined in OpenID 1.1, so SREG (with the namespace URI as in the example above) is supported as a special case. All other extension namespaces will be silently ignored when making a 1.1 request.
The default value, false, means that the identity provider 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, whether to retry the request with "delayed_return" set true (the only way to proceed in version 2.0) or to somehow send (be it link, redirect, or pop-up window) the user the provider's user_setup_url (which is made available in version 1.0/1.1).
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 either (1.0/1.1) get the user_setup_url and present it to the user somehow or (2.0) launch a delayed_return request from an actual window if the AJAX-style request fails.
See Net::OpenID::Consumer for author, copyright and licensing information.
Net::OpenID::Consumer
Net::OpenID::VerifiedIdentity
Net::OpenID::Server
Website: <http://www.openid.net/>
2022-06-30 | perl v5.34.0 |