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