Login Plugins

Login Plugins mostly play a support role: They can be called by all other plugins: Metadata, Downloader and Script Plugins. Their role is to provide a configured Mojo::UserAgent object that can be used to perform authenticated operations on a remote Web service.

Required subroutines

Only one subroutine needs to be implemented for the module to be recognized: do_login, which contains your working code. You're free to implement other subroutines for cleaner code, of course.

Expected Input

When executing your Plugin, LRR will call the do_login subroutine and give it the following variables:

sub do_login {

    #First lines you should have in the subroutine
    shift;
    my ($params) = @_; # Plugin parameters

The $params hash contains the values of the user defined parameters.

Expected Output

Your plugin must return a Mojo::UserAgent object. That's it!

There's no particular error handling for Login Plugins at the moment, so I recommend you return an empty UserAgent if Login fails and handle the error in the matching Metadata/Script plugin.

Plugin Template

Converting existing plugins to named parameters

If you have a plugin that you want to convert to using named parameters check Converting existing plugins to named parameters in the Metadata section.

Last updated

Was this helpful?