1Web::ID(3) User Contributed Perl Documentation Web::ID(3)
2
3
4
6 Web::ID - implementation of WebID (a.k.a. FOAF+SSL)
7
9 my $webid = Web::ID->new(certificate => $pem_encoded_x509);
10 if ($webid->valid)
11 {
12 say "Authenticated as: ", $webid->uri;
13 }
14
16 WebID is a simple authentication protocol based on TLS (Transaction
17 Layer Security, better known as Secure Socket Layer, SSL) and the
18 Semantic Web. This module provides a Perl implementation for
19 authenticating clients using WebID.
20
21 For more information see the Web::ID::FAQ document.
22
23 Bundled with this module are Plack::Middleware::Auth::WebID, a plugin
24 for Plack to perform WebID authentication on HTTPS connections; and
25 Web::ID::Certificate::Generator, a module that allows you to generate
26 WebID-enabled certificates that can be installed into web browsers.
27
28 Constructor
29 "new"
30 Standard Moose-style constructor.
31
32 Attributes
33 "certificate"
34 A Web::ID::Certificate object representing and x509 certificate,
35 though a PEM-encoded string will be coerced.
36
37 This is usually the only attribute you want to pass to the
38 constructor. Allow the others to be built automatically.
39
40 "first_valid_san"
41 Probably fairly uninteresting. This is the first subjectAltName
42 value found in the certificate that could be successfully
43 authenticated using Web::ID. An Web::ID::SAN object.
44
45 "uri"
46 The URI associated with the first valid SAN. A URI object.
47
48 This is a URI you can use to identify the person, organisation or
49 robotic poodle holding the certificate.
50
51 "profile"
52 Data about the certificate holder. An RDF::Trine::Model object.
53 Their FOAF file (probably).
54
55 "valid"
56 Boolean.
57
58 Methods
59 "node"
60 Returns the same as "uri", but as an RDF::Trine::Node object.
61
62 "get(@predicates)"
63 Queries the "profile" for triples of the form:
64
65 $self->node $predicate $x .
66
67 And returns literal and URI values for $x, as strings.
68
69 $predicate should be an RDF::Trine::Node, or a string. If a string,
70 it will be expanded using RDF::Trine::NamespaceMap, so you can do
71 stuff like:
72
73 my $name = $webid->get('foaf:name', 'rdfs:label');
74 my @mboxes = $webid->get('foaf:mbox');
75
77 Please report any bugs to
78 <http://rt.cpan.org/Dist/Display.html?Queue=Web-ID>.
79
81 Web::ID::FAQ.
82
83 Web::ID::Certificate, Plack::Middleware::Auth::WebID.
84
85 RDF::ACL provides an access control system that complements WebID.
86
87 CGI::Auth::FOAF_SSL is the spiritual ancestor of this module though
88 they share very little code, and have quite different APIs.
89
90 General WebID information: <http://webid.info/>,
91 <http://www.w3.org/wiki/WebID>,
92 <http://www.w3.org/2005/Incubator/webid/spec/>,
93 <http://lists.foaf-project.org/mailman/listinfo/foaf-protocols>.
94
95 Mailing list for general Perl RDF/SemWeb discussion and support:
96 <http://www.perlrdf.org/>.
97
99 Toby Inkster <tobyink@cpan.org>.
100
102 Thanks to Kjetil Kjernsmo (cpan:KJETILK) for persuading me to port my
103 old CGI-specific implementaton of this to Plack.
104
105 Thanks Kjetil Kjernsmo (again), Florian Ragwitz (cpan:FLORA), and Jonas
106 Smedegaard for help with testing and advice on dependencies.
107
108 Thanks to Henry Story, Melvin Carvalho, Simon Reinhardt, Bruno
109 Harbulot, Ian Jacobi and many others for developing WebID from a poorly
110 thought out idea to a clever, yet simple and practical authentication
111 protocol.
112
113 Thanks to Gregory Williams (cpan:GWILLIAMS), Tatsuhiko Miyagawa
114 (cpan:MIYAGAWA) and the Moose Cabal for providing really good platforms
115 (RDF::Trine, Plack and Moose respectively) to build this on.
116
118 This software is copyright (c) 2012 by Toby Inkster.
119
120 This is free software; you can redistribute it and/or modify it under
121 the same terms as the Perl 5 programming language system itself.
122
124 THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
125 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
126 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
127
128
129
130perl v5.28.1 2014-05-10 Web::ID(3)