Bio::Graphics::Browser2::Plugin::AuthPlugin(3pm) | User Contributed Perl Documentation | Bio::Graphics::Browser2::Plugin::AuthPlugin(3pm) |
Bio::Graphics::Browser2::Plugin::AuthPlugin -- Base class for authentication plugins
package Bio::Graphics::Browser2::Plugin::MyPlugin; use base 'Bio::Graphics::Browser2::Plugin::AuthPlugin'; sub authenticate { my $self = shift; my ($user,$password) = $self->credentials; return unless $user eq 'george' && $password eq 'washington'; return ($user,'George Washington','george@whitehouse.gov'); } sub user_in_group { my $self = shift; my ($user,$group) = @_; return $user eq 'george' && $group eq 'potomac'; }
This is a template for authorizer plugins. To define a new type of authorizer, you need only inherit from this class and define an authenticate() method. This method takes two arguments: the username and password and returns an empty list if authentication fails, or a list of (username, fullname, email) if authentication succeeds (fullname and email are optional).
In addition, you may override the user_in_group() method, which takes two argumetns: the username and group. Return true if the user belongs to the group, and false otherwise.
Other methods you may wish to override include:
* authentication_hint() * authentication_help() * configure_form() * reconfigure() * credentials()
These are described below.
The default behavior is to take this value from the "login hint" option in a stanza named [AuthPlugin:plugin]. Example:
The default behavior is to take this value from the "login help" option in a stanza named [AuthPlugin:plugin].
[AuthPlugin:plugin] login hint = your Acme Corp Single Sign-on Account login help = <a href="www.acme.com/passwd_help">Recover forgotten password</a>
Bio::Graphics::Browser2
Lincoln Stein <lincoln.stein@gmail.com<gt>.
Copyright (c) 2011 Ontario Institute for Cancer Research
This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.
2018-10-03 | perl v5.26.2 |