WebService::Cmis::Agent::TokenAuth - token-based authentication handler
This user agent adds tocken-based authentication for subsequent calls to the CMIS backend while the first one is still performed using HTTP basic auth. Alfresco is one server that implements token-based authentication.
my $client = WebService::Cmis::getClient( url => "http://cmis.alfresco.com/service/cmis", useragent => new WebService::Cmis::Agent::TokenAuth( loginUrl => "http://cmis.alfresco.com/service/api/login?u={username}&pw={password}", logoutUrl => "http://cmis.alfresco.com/service/api/login/ticket/{ticket}" ) ); $client->login( user => "user", password => "password", ); my $repo = $client->getRepository;
Parent class: WebService::Cmis::Agent
Create a new WebService::Cmis::Agent::TokenAuth. It remembers the session state using a token that is used instead of the normal user credentials to authenticate.
Parameters:
user
password
loginUrl - url used for ticket-based authentication; example:
"http://cmis.alfresco.com/service/api/login?u={username}&pw={password}"
logoutUrl - url used for ticket-based authentication; example:
"http://cmis.alfresco.com/service/api/login/ticket/{ticket}"
See LWP::UserAgent for more options.
logs in to the web service
ticket
Login using basic auth. A ticket will be aquired to be used for later logins for the same user.
my $ticket = $client->login({ user => "user", password => "pasword" }); $client->login({ user => "user", ticket => "ticket" });
logs out of the web service deleting a ticket previously aquired
overrides the method in LWP::UserAgent to implement the given authentication mechanism.
Copyright 2012-2013 Michael Daum
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/artistic.html.
To install WebService::Cmis, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Cmis
CPAN shell
perl -MCPAN -e shell install WebService::Cmis
For more information on module installation, please visit the detailed CPAN module installation guide.