Bio-Das-ProServer
view release on metacpan or search on metacpan
lib/Bio/Das/ProServer/Authenticator/http.pm view on Meta::CPAN
2. Check for cached results for this token.
3. If not found, query the remote server.
4. Store the response in the cache, unless it is a server error (500)
4. If the response code is 200 allow the request, otherwise deny.
=head2 parse_token : Parses the DAS request to extract an authentication token
Requires: a hash reference containing details of the DAS request
Returns: a string authentication token
my $token = $oAuth->parse_token({
'peer_addr' => $, # packed
'request' => $, # HTTP::Request object
'cgi' => $, # CGI object
...
});
Depending on configuration, the authentication token is extracted from:
1. a named cookie
2. a named CGI parameter
3. a named request header
4. the 'Authorization' request header (default)
This method may be overridden to extract the token in a different manner.
=head1 DIAGNOSTICS
my $auth = Bio::Das::ProServer::Authenticator::http->new({
...
'debug' => 1,
});
=head1 CONFIGURATION AND ENVIRONMENT
The URL to use for remote authentication is configured in the source INI section.
Any instances of "%token" will be replaced by the value of the authentication
token parsed from the DAS request.
[mysource]
authenticator = http
authurl = http://auth.example.com/is_allowed?query=%token
; Optionally define location of auth token (default is 'Authorization' header)
; authcookie = cookiename
; authheader = headername
; authparam = cgiparamname
An HTTP proxy may be specified in the shell environment.
=head1 DEPENDENCIES
=over
=item L<Carp|Carp>
=item L<Bio::Das::ProServer::Authenticator|Bio::Das::ProServer::Authenticator>
=item L<LWP::UserAgent|LWP::UserAgent>
=back
=head1 BUGS AND LIMITATIONS
This authenticator implementation may only be used to ask yes/no questions,
such as "does this token identify a user with sufficient privileges?". Questions
such as "which user does this token identify?" have additional security
implications and are therefore not supported.
=head1 INCOMPATIBILITIES
None reported.
=head1 AUTHOR
Andy Jenkinson <andy.jenkinson@ebi.ac.uk>
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2008 EMBL-EBI
=cut
( run in 0.523 second using v1.01-cache-2.11-cpan-39bf76dae61 )