1Net::OpenID::ClaimedIdeUnsteirtyC(o3n)tributed Perl DocuNmeetn:t:aOtpieonnID::ClaimedIdentity(3)
2
3
4
6 Net::OpenID::ClaimedIdentity - A not-yet-verified OpenID identity
7
9 version 1.18
10
12 use Net::OpenID::Consumer;
13 my $csr = Net::OpenID::Consumer->new;
14 ....
15 my $cident = $csr->claimed_identity("bradfitz.com")
16 or die $csr->err;
17
18 if ($AJAX_mode) {
19 my $url = $cident->claimed_url;
20 my $openid_server = $cident->identity_server;
21 # ... return JSON with those to user agent (whose request was
22 # XMLHttpRequest, probably)
23 }
24
25 if ($CLASSIC_mode) {
26 my $check_url = $cident->check_url(
27 delayed_return => 1,
28 return_to => "http://example.com/get-identity.app",
29 trust_root => "http://*.example.com/",
30 );
31 WebApp::redirect($check_url);
32 }
33
35 After Net::OpenID::Consumer crawls a user's declared identity URL and
36 finds openid.server link tags in the HTML head, you get this object.
37 It represents an identity that can be verified with OpenID (the link
38 tags are present), but hasn't been actually verified yet.
39
41 $url = $cident->claimed_url
42 The URL, now canonicalized, that the user claims to own. You can't
43 know whether or not they do own it yet until you send them off to
44 the check_url, though.
45
46 $id_server = $cident->identity_server
47 Returns the identity provider that will assert whether or not this
48 claimed identity is valid, and sign a message saying so.
49
50 $url = $cident->delegated_url
51 If the claimed URL is using delegation, this returns the delegated
52 identity that will actually be sent to the identity provider.
53
54 $version = $cident->protocol_version
55 Determines whether this identifier is to be verified by OpenID 1.1
56 or by OpenID 2.0. Returns 1 or 2 respectively. This will affect the
57 way the "check_url" is constructed.
58
59 $cident->set_extension_args($ns_uri, $args)
60 If called before you access "check_url", the arguments given in the
61 hashref $args will be added to the request in the given extension
62 namespace. For example, to use the Simple Registration (SREG)
63 extension:
64
65 $cident->set_extension_args(
66 'http://openid.net/extensions/sreg/1.1',
67 {
68 required => 'email',
69 optional => 'fullname,nickname',
70 policy_url => 'http://example.com/privacypolicy.html',
71 },
72 );
73
74 Note that when making an OpenID 1.1 request, only the Simple
75 Registration extension is supported. There was no general extension
76 mechanism defined in OpenID 1.1, so SREG (with the namespace URI as
77 in the example above) is supported as a special case. All other
78 extension namespaces will be silently ignored when making a 1.1
79 request.
80
81 $url = $cident->check_url( %opts )
82 Makes the URL that you have to somehow send the user to in order to
83 validate their identity. The options to put in %opts are:
84
85 "return_to"
86 The URL that the identity provider should redirect the user
87 with either a verified identity signature -or- a setup_needed
88 message (indicating actual interaction with the user is
89 required before an assertion can be made). This URL may
90 contain query parameters, and the identity provider must
91 preserve them.
92
93 "trust_root"
94 The URL that you want the user to actually see and declare
95 trust for. Your "return_to" URL must be at or below your
96 trust_root. Sending the trust_root is optional, and defaults
97 to your "return_to" value, but it's highly recommended (and
98 prettier for users) to see a simple trust_root. Note that the
99 trust root may contain a wildcard at the beginning of the host,
100 like "http://*.example.com/"
101
102 "delayed_return"
103 If set to a true value, the check_url returned will indicate to
104 the user's identity provider that it has permission to control
105 the user's user-agent for awhile, giving them real pages (not
106 just redirects) and lets them bounce around the identity
107 provider site for a while until the requested assertion can be
108 made, and they can finally be redirected back to your return_to
109 URL above.
110
111 The default value, false, means that the identity provider will
112 immediately return to your return_to URL with either a "yes" or
113 "no" answer. In the "no" case, you'll instead have control of
114 what to do, whether to retry the request with "delayed_return"
115 set true (the only way to proceed in version 2.0) or to somehow
116 send (be it link, redirect, or pop-up window) the user the
117 provider's user_setup_url (which is made available in version
118 1.0/1.1).
119
120 When writing a dynamic "AJAX"-style application, you can't use
121 delayed_return because the remote site can't usefully take
122 control of a 1x1 pixel hidden IFRAME, so you'll need to either
123 (1.0/1.1) get the user_setup_url and present it to the user
124 somehow or (2.0) launch a delayed_return request from an actual
125 window if the AJAX-style request fails.
126
128 See Net::OpenID::Consumer for author, copyright and licensing
129 information.
130
132 Net::OpenID::Consumer
133
134 Net::OpenID::VerifiedIdentity
135
136 Net::OpenID::Server
137
138 Website: <http://www.openid.net/>
139
140
141
142perl v5.32.0 2020-07-28 Net::OpenID::ClaimedIdentity(3)