Michael Daum > WebService-Cmis-0.09 > WebService::Cmis::Agent::CookieAuth

Download:
WebService-Cmis-0.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

NAME ^

WebService::Cmis::Agent::CookieAuth - cookie-based authentication handler

DESCRIPTION ^

This user agent allows to remain logged in based on cookie information returned by the server.

  my $client = WebService::Cmis::getClient(
    url => "http://localhost:8080/nuxeo/atom/cmis",
    useragent => new WebService::Cmis::Agent::CookieAuth(
      user => "user",
      password => "password",
      loginUrl => "http://localhost:8080/nuxeo/nxstartup.faces",
      cookieDir => "/tmp",
    )
  );
  
  my $cookie = $client->login;
  my $repo = $client->getRepository;

Parent class: WebService::Cmis::Agent

METHODS ^

new(%params)

Create a new WebService::Cmis::Agent::CookieAuth.

Parameters:

  • user
  • password
  • loginUrl (defaults to the cmis client's atom endpoint)
  • cookieDir (defaults to /tmp)

See LWP::UserAgent for more options.

login(%params) -> $cookie

logs in to the web service

Parameters:

  • user
  • password
  • cookie

Login using basic auth or based on a cookie previously collected.

  my $cookie = $client->login({
    user => "user", 
    password => "pasword"
  });

  $client->login({
    cookie => $cookie
  });
logout()

logs out of the web service deleting a cookie previously aquired

get_basic_credentials()

overrides the method in LWP::UserAgent to implement the given authentication mechanism.

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: