view release on metacpan or search on metacpan
lib/HTTP/Headers/ActionPack/Authorization/Basic.pm view on Meta::CPAN
use parent 'HTTP::Headers::ActionPack::Core::Base';
sub BUILDARGS {
my $class = shift;
my $type = shift || confess "Must specify type";
my $credentials = shift || confess "Must provide credentials";
if ( ref $credentials && ref $credentials eq 'HASH' ) {
return +{ auth_type => $type, %$credentials };
}
elsif ( ref $credentials && ref $credentials eq 'ARRAY' ) {
my ($username, $password) = @$credentials;
return +{ auth_type => $type, username => $username, password => $password };
}
else {
my ($username, $password) = split ':' => decode_base64( $credentials );
return +{ auth_type => $type, username => $username, password => $password };
}
}
sub new_from_string {
my ($class, $header_string) = @_;
my ($type, $credentials) = split /\s/ => $header_string;
($type eq 'Basic')
|| confess "The type must be 'Basic', not '$type'";
$class->new( $type, $credentials );
}
sub auth_type { (shift)->{'auth_type'} }
sub username { (shift)->{'username'} }
sub password { (shift)->{'password'} }
lib/HTTP/Headers/ActionPack/Authorization/Basic.pm view on Meta::CPAN
=head1 METHODS
=over 4
=item C<new ( $type, $credentials )>
The C<$credentials> argument can either be a Base64 encoded string (as
would be passed in via the header), a HASH ref with username and password
keys, or a two element ARRAY ref where the first element is the username
and the second the password.
=item C<new_from_string ( $header_string )>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Promise/Headers.pm view on Meta::CPAN
# NOTE: Allow is a response header
# <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow>
sub allow { return( shift->_set_get_multi( 'Allow', @_ ) ); }
# Response header: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials>
sub allow_credentials { return( shift->_set_get_one( 'Access-Control-Allow-Credentials', @_ ) ); }
# Response header <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers>
sub allow_headers { return( shift->_set_get_multi( 'Access-Control-Allow-Headers', @_ ) ); }
# <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods>
lib/HTTP/Promise/Headers.pm view on Meta::CPAN
This is a server response header.
See L<rfc7231, section 7.4.1|https://tools.ietf.org/html/rfc7231#section-7.4.1> and L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age>
=head2 allow_credentials
# Access-Control-Allow-Credentials: true
$h->allow_credentials( 'true' );
Sets or gets the C<Access-Control-Allow-Credentials> header field value. It takes a string boolean value: C<true> or C<false>.
See L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials>
view all matches for this distribution
view release on metacpan or search on metacpan
eg/proxy-auth.pl view on Meta::CPAN
$proxy->push_filter(
request => HTTP::Proxy::HeaderFilter::simple->new(
sub {
my ( $self, $headers, $request ) = @_;
# check the token against all credentials
my $ok = 0;
$_ eq $token && $ok++
for $self->proxy->hop_headers->header('Proxy-Authorization');
# no valid credential
view all matches for this distribution
view release on metacpan or search on metacpan
QuickBase.pm view on Meta::CPAN
'apptoken' => "",
'error' => undef,
'errortext' => undef,
'username' => undef,
'password' => undef,
'credentials' => undef,
'proxy' => undef,
'realmhost' => undef
}, $class;
}
QuickBase.pm view on Meta::CPAN
my($self, $username, $password) = @_;
$self->{'username'} = $username;
$self->{'password'} = $password;
$username = $self->xml_escape($username);
$password = $self->xml_escape($password);
$self->{'credentials'} = "<username>$username<\/username><password>$password<\/password>";
$self->{'ticket'}="";
return "";
}
sub setAppToken($)
QuickBase.pm view on Meta::CPAN
#First we have to get the authorization ticket
#We do this by posting the QuickBase username and password to QuickBase
#This is where we post the QuickBase username and password
my $res = $self->PostAPIURL ("main", "API_Authenticate",
"<qdbapi>".
$self->{'credentials'}.
"</qdbapi>");
if ($res->content =~ /<errcode>(.*?)<\/errcode>.*?<errtext>(.*?)<\/errtext>/s)
{
$self->{'error'} = $1;
$self->{'errortext'} = $2;
QuickBase.pm view on Meta::CPAN
}
if ($self->{'error'} eq '0')
{
$res->content =~ /<ticket>(.*?)<\/ticket>/s;
$self->{'ticket'} = $1;
$self->{'credentials'} = "<ticket>$self->{'ticket'}<\/ticket>";
}
else
{
return "";
}
QuickBase.pm view on Meta::CPAN
}
$req->content_type('text/xml');
$req->header('QUICKBASE-ACTION' => "$action");
if ($self->{'apptoken'} ne "" && $self->{'credentials'} !~ /<apptoken>/)
{
$self->{'credentials'} .= "<apptoken>".$self->{'apptoken'}."</apptoken>";
}
if($content =~ /^<qdbapi>/)
{
$content =~s/^<qdbapi>/<qdbapi>$self->{'credentials'}/;
}
elsif($content eq "" || !defined($content))
{
$content ="<qdbapi>$self->{'credentials'}</qdbapi>";
}
if($content =~ /^<qdbapi>/)
{
$content = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" . $content;
}
QuickBase.pm view on Meta::CPAN
return $res;
}
if (defined ($res->header('Set-Cookie')) && $res->header('Set-Cookie') =~ /TICKET=(.+?);/)
{
$self->{'ticket'} = $1;
$self->{'credentials'} = "<ticket>$self->{'ticket'}</ticket>";
}
elsif ($res->content =~ /<ticket>(.+?)<\/ticket>/)
{
$self->{'ticket'} = $1;
$self->{'credentials'} = "<ticket>$self->{'ticket'}</ticket>";
}
$res->content =~ /<errcode>(.*?)<\/errcode>.*?<errtext>(.*?)<\/errtext>/s;
$self->{'error'} = $1;
$self->{'errortext'} = $2;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Request/CurlParameters.pm view on Meta::CPAN
default => sub { {} },
);
=item *
C<credentials>
credentials => 'hunter2:secret'
The credentials to use for basic authentication.
=cut
has credentials => (
is => 'ro',
);
=item *
lib/HTTP/Request/CurlParameters.pm view on Meta::CPAN
maybe timeout => $self->timeout,
maybe cookie_jar => $init_cookie_jar->{code},
maybe SSL_opts => keys %ssl_options ? \%ssl_options : undef,
], '')
;
if( defined( my $credentials = $self->credentials )) {
my( $user, $pass ) = split /:/, $credentials, 2;
my $setup_credentials = sprintf qq{\$ua->credentials("%s","%s");},
quotemeta $user,
quotemeta $pass;
push @setup_ua, $setup_credentials;
};
if( $self->show_error ) {
push @postamble,
' die $res->message if $res->is_error;',
} elsif( $self->fail ) {
lib/HTTP/Request/CurlParameters.pm view on Meta::CPAN
maybe max_size => $self->max_filesize,
maybe cookie_jar => $init_cookie_jar->{code},
maybe SSL_options => keys %ssl_options ? \%ssl_options : undef,
], '')
;
if( defined( my $credentials = $self->credentials )) {
my( $user, $pass ) = split /:/, $credentials, 2;
my $setup_credentials = sprintf qq{\$ua->credentials("%s","%s");},
quotemeta $user,
quotemeta $pass;
push @setup_ua, $setup_credentials;
};
@setup_ua = ()
if @setup_ua == 1;
lib/HTTP/Request/CurlParameters.pm view on Meta::CPAN
maybe max_response_size => $self->max_filesize,
maybe cookie_jar => $init_cookie_jar->{code},
maybe SSL_options => keys %ssl_options ? \%ssl_options : undef,
], '')
;
if( defined( my $credentials = $self->credentials )) {
my( $user, $pass ) = split /:/, $credentials, 2;
my $setup_credentials = sprintf qq{\$ua->userinfo("%s","%s");},
quotemeta $user,
quotemeta $pass;
push @setup_ua, $setup_credentials;
};
@setup_ua = ()
if @setup_ua == 1;
view all matches for this distribution
view release on metacpan or search on metacpan
$url = "http://127.0.0.1:1024/index.html";
$response = $ua->get($url);
is($response->code, 401, "Response has HTTP Base Authorization (401) status");
$ua->credentials( "127.0.0.1:1024", "Colonel Authentication System", "username", "passwd" );
$response = $ua->get($url);
is($response->code, 200, "Response has HTTP OK (2xx) status");
$url = "http://127.0.0.1:1024/page_no_found";
$response = $ua->get($url);
view all matches for this distribution
view release on metacpan or search on metacpan
Singlethreaded.pm view on Meta::CPAN
as an example of featureitis.
=head2 $uid and $gid
when starting as root in a *nix, specify these numerically. The
process credentials will be changed after the listening sockets
are bound.
=head1 Dynamic Reconfiguration
Dynamic reconfiguration is possible, either by directly altering
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Size.pm view on Meta::CPAN
=head1 TO DO
* if i have to use GET, i should use Byte-Ranges to avoid
downloading the whole thing
* add a way to specify Basic Auth credentials
* download javascript and style sheets too.
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/Throwable/Role/Status/Unauthorized.pm view on Meta::CPAN
The request requires user authentication. The response MUST include a
WWW-Authenticate header field containing a challenge applicable to the
requested resource. The client MAY repeat the request with a suitable
Authorization header field. If the request already included Authorization
credentials, then the 401 response indicates that authorization has been
refused for those credentials. If the 401 response contains the same
challenge as the prior response, and the user agent has already attempted
authentication at least once, then the user SHOULD be presented the entity
that was given in the response, since that entity might include relevant
diagnostic information.
lib/HTTP/Throwable/Role/Status/Unauthorized.pm view on Meta::CPAN
#pod
#pod The request requires user authentication. The response MUST include a
#pod WWW-Authenticate header field containing a challenge applicable to the
#pod requested resource. The client MAY repeat the request with a suitable
#pod Authorization header field. If the request already included Authorization
#pod credentials, then the 401 response indicates that authorization has been
#pod refused for those credentials. If the 401 response contains the same
#pod challenge as the prior response, and the user agent has already attempted
#pod authentication at least once, then the user SHOULD be presented the entity
#pod that was given in the response, since that entity might include relevant
#pod diagnostic information.
#pod
view all matches for this distribution
view release on metacpan or search on metacpan
example/testdefs.xml view on Meta::CPAN
<user_agent>Mozilla/5.0 (HTTP-WebTest)</user_agent>
<!-- send to these mail addresses (element may be repeated) -->
<mail_addresses>NOC <noc@isp.tld></mail_addresses>
<mail_from>WebTest <webtest@isp.tld></mail_from>
<!-- do not specify the email element for now; this will break the XML report -->
<!-- basic auth. credentials, used if requested by http server -->
<auth>user</auth>
<auth>secretpass</auth>
</param>
<!-- test groups specify tests to apply to a html page
view all matches for this distribution
view release on metacpan or search on metacpan
t/testdefs.xml view on Meta::CPAN
<list name="mail_addresses">
<param>NOC <noc@isp.tld></param>
</list>
<param name="mail_from">WebTest <webtest@isp.tld></param>
<!-- do not specify the email element for now; this will break the XML report -->
<!-- basic auth. credentials, used if requested by http server -->
<list name="auth">
<param>user</param>
<param>secretpass</param>
</list>
</params>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTTP/WebTest/SelfTest.pm view on Meta::CPAN
@EXPORT = qw($HOSTNAME $PORT $URL
abs_url
check_webtest
read_file write_file
generate_testfile canonical_output compare_output
parse_basic_credentials
start_webserver stop_webserver);
use Algorithm::Diff qw(diff);
use MIME::Base64;
use URI;
lib/HTTP/WebTest/SelfTest.pm view on Meta::CPAN
printf "%s %03d %s\n", @$diff_str;
}
}
}
=head2 parse_basic_credentials($credentials)
Decodes credentials for Basic authorization scheme according RFC2617.
=head3 Returns
Returns user/password pair.
=cut
sub parse_basic_credentials {
my $credentials = shift;
return () unless defined $credentials;
$credentials =~ m|^ \s* Basic \s+ ([A-Za-z0-9+/=]+) \s* $|x;
my $basic_credentials = $1;
return () unless defined $basic_credentials;
my $user_pass = decode_base64($basic_credentials);
my($user, $password) = $user_pass =~ /^ (.*) : (.*) $/x;
return () unless defined $password;
return ($user, $password);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Haineko.pm view on Meta::CPAN
Defines "mailer table" which decide the mailer by sender's domain part.
=head2 C<etc/authinfo>
Provide credentials for client side authentication information. Credentials
defined in this file are used at relaying an email to external SMTP server.
This file should be set secure permission: The only user who runs haineko server
can read this file.
view all matches for this distribution
view release on metacpan or search on metacpan
Word/noun.txt view on Meta::CPAN
creation,creations
creationist,creationists
creator,creators
creature,creatures
creche,creches
credential,credentials
credit,credits
creditor,creditors
creed,creeds
creek,creeks
creel,creels
view all matches for this distribution
view release on metacpan or search on metacpan
t/HealthCheck-Diagnostic-SSH.t view on Meta::CPAN
$hc = HealthCheck::Diagnostic::SSH->new( %default );
$res = $hc->check;
is $res, {
%success_res,
info => "Successful connection for $user\@$host SSH",
}, "Healthcheck completed using local user credentials";
# health check should fail with incorrect user overriden
$res = $hc->check( user => 'invalid-user' );
like $res->{info}, qr/invalid-user.*Permission denied/,
"Healthcheck result displays overridden parameters";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hetula/Client.pm view on Meta::CPAN
use Data::Printer;
=head3 new
@param1 {HASHRef} baseURL => https://hetula.example.com
credentials => filepath, Where to load the credentials file.
see slurpCredentials() for more info.
=cut
sub new($class, $params) {
slurpCredentials($params->{credentials}, $params) if ($params->{credentials});
_detectKohaEnvironment($params);
die("Hetula::Client::BadParam - parameter 'baseURL' is missing") unless $params->{baseURL};
die("Hetula::Client::BadParam - parameter 'baseURL' '$params->{baseURL}' is not a valid URI") unless $params->{baseURL} =~ /$RE{URI}{HTTP}{-scheme=>qr!https?!}/;
my $s = bless(Storable::dclone($params), $class);
lib/Hetula/Client.pm view on Meta::CPAN
=head3 login
See Hetula API doc for endpoint POST /api/v1/auth
@param1 {HASHRef} username => String || undef if given via credentials during construction,
password => String || undef if given via credentials during construction,
organization => String || undef if given via credentials during construction,
=cut
sub login($s, $params={}) {
$params->{username} = $s->{username} unless $params->{username};
lib/Hetula/Client.pm view on Meta::CPAN
=head2 HELPERS
=head3 slurpCredentials
@static
Reads the contents of a credentials file.
The credentials file must consist of up to 4 lines, with each line
specifying the following commandline argument replacements:
username
password
organization
url
@param1 {String} Path to the credentials file
@param2 {HASHRef} Optional, HASHRef where to inject the found credentials
=cut
sub slurpCredentials($credentialsFile, $injectHere=undef) {
open(my $FH, '<:encoding(UTF-8)', $credentialsFile) or die("Couldn't read '$credentialsFile': $!");
my $username = <$FH>; if ($username) { chomp($username); $injectHere->{username} = $username if $username && $injectHere; }
my $password = <$FH>; if ($password) { chomp($password); $injectHere->{password} = $password if $password && $injectHere; }
my $organization = <$FH>; if ($organization) { chomp($organization); $injectHere->{organization} = $organization if $organization && $injectHere; }
my $baseURL = <$FH>; if ($baseURL) { chomp($baseURL); $injectHere->{baseURL} = $baseURL if $baseURL && $injectHere; }
return ($username, $password, $organization, $baseURL);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HoneyClient/Manager/VM.pm view on Meta::CPAN
our $chdirSemaphore = Thread::Semaphore->new(1);
# Constants used to authenticate with the VMware Server /
# GSX server.
# If username and password are left undefined,
# the process owner's credentials will be used.
our $serverName : shared = undef;
our $tcpPort : shared = getVar(name => "vmware_port");
our $username : shared = undef;
our $passwd : shared = undef;
lib/HoneyClient/Manager/VM.pm view on Meta::CPAN
_emitQueuedFault();
# Define the parameters used to connect to the VMware Server / GSX server.
# If any of these parameters are undefined, defaults will be used.
# For example, the process owner's credentials will be used
# for username/passwd if undefined.
$connectParams = VMware::VmPerl::ConnectParams::new($serverName, $tcpPort, $username, $passwd);
# Establish a persistent connection with server.
$server = VMware::VmPerl::Server::new();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hopkins/Plugin/HMI/Catalyst/Controller/Root.pm view on Meta::CPAN
sub login_POST : Private
{
my $self = shift;
my $c = shift;
my $credentials = {};
$credentials->{username} = scalar $c->req->params->{username};
$credentials->{password} = scalar $c->req->params->{password};
$c->detach('/default') if $c->authenticate($credentials);
$c->stash->{error} = 'login incorrect';
$c->detach('/login_GET');
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Hubot/Scripts/tweet.pm view on Meta::CPAN
. uri_escape( $ENV{HUBOT_TWITTER_CONSUMER_SECRET} )
}
);
$client->post(
{ grant_type => 'client_credentials' },
sub {
my ( $body, $hdr ) = @_;
return if !$body;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/I22r/Translate/Microsoft.pm view on Meta::CPAN
$token->{secretx} = url_encode( $secret );
}
$token->{client_idx} = url_encode( $client_id );
my $content = join( '&',
'grant_type=client_credentials',
'client_id=' . $token->{client_idx},
'client_secret=' . $token->{secretx},
'scope=http://api.microsofttranslator.com/' );
my $headers = HTTP::Headers->new(
lib/I22r/Translate/Microsoft.pm view on Meta::CPAN
This package interacts with the Microsoft Translator API,
which requires some you/us to provide a "client id" and
"client secret" to access Microsoft's data services.
As of October 2012, here are the steps you need to take
to get those credentials. (If these steps don't work anymore,
and you do figure out what steps you need to do, L<let me
know|mailto:mob@cpan.org> or L<file a bug report|"SUPPORT">
and I'll update this document.
=over 4
lib/I22r/Translate/Microsoft.pm view on Meta::CPAN
ENABLED => 1,
CLIENT_ID => "angus",
SECRET => "ykiDjfQ9lztW/oFUC4t2ciPWH2nJS88FqXcQbs/Z9Y=7"
} );
(these are not real credentials).
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
t/Constants.pm view on Meta::CPAN
# API keys for testing and development.
if (-f "t/Constants.pmx" && !$ENV{RELEASE}) {
# t/Constants.pmx is a file, not included with the I22r-Translate
# distribution, that resides on the author's system and contains
# his Google and Microsoft credentials.
require "t/Constants.pmx";
} else {
$t::Constants::GOOGLE_API_KEY = "get_a_Google_API_key_and_set_this_value";
$t::Constants::CONFIGURED = 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
DataAccess.pod view on Meta::CPAN
=item -12 Unable to access the history file (LL_HISTORY_FILE query only)
=item -13 DCE identity of calling program can not be established
=item -14 No DCE credentials
=item -15 DCE credentials within 300 secs of expiration
=item -16 64-bit API is not supported when DCE is enabled
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IDS/DataSource/HTTP/Authorization.pm view on Meta::CPAN
undef $self->{"data"}, $self->{"tokens"};
}
sub parse {
my $self = shift;
my $credentials = $self->{"data"}; # convenience
my @tokens = ();
$self->mesg(1, *parse{PACKAGE} . "::parse: data '$credentials'");
my $base64pat = qr![0-9A-Za-z+/=]+!;
### Need to fill this out with more auth styles
if ($credentials =~ /^Basic\s+($base64pat+)$/) {
push @tokens, "Basic auth credentials";
### should have a param to indicate whether or not to include
### the hash
} else {
my $pmsg = *parse{PACKAGE} . "::parse: In " .
${$self->{"params"}}{"source"} .
" unknown auth credentials '$credentials'\n";
$self->warn($pmsg, \@tokens, "!unknown auth credentials");
}
$self->mesg(2, *parse{PACKAGE} . "::parse: tokens\n ",
"\n ", \@tokens);
$self->{"tokens"} = \@tokens;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IM/Engine.pm view on Meta::CPAN
=head1 SYNOPSIS
IM::Engine->new(
interface => {
protocol => 'AIM',
credentials => {
screenname => '...',
password => '...',
},
incoming_callback => sub {
my $incoming = shift;
lib/IM/Engine.pm view on Meta::CPAN
Talks AIM using L<Net::OSCAR>:
IM::Engine->new(
interface => {
protocol => 'AIM',
credentials => {
screenname => 'foo',
password => '...',
},
},
# ...
lib/IM/Engine.pm view on Meta::CPAN
Talks XMPP using L<AnyEvent::XMPP>:
IM::Engine->new(
interface => {
protocol => 'Jabber',
credentials => {
jid => 'foo@gchat.com',
password => '...',
},
},
# ...
lib/IM/Engine.pm view on Meta::CPAN
Talks IRC using L<AnyEvent::IRC>:
IM::Engine->new(
interface => {
protocol => 'IRC',
credentials => {
server => "irc.perl.org",
port => 6667,
channels => ["#moose", "#im-engine"],
nick => "Boot",
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IO/EventMux.pm view on Meta::CPAN
=item accepted
A new client connected to a listening socket and the connection was accepted by
EventMux. The listening socket file handle is in the 'parent_fh' key. If the
file handle is a unix domain socket the credentials of the user connection will be available in the keys; 'pid', 'uid' and 'gid'.
=item ready
A file handle is ready to be written to, this can be use full when working with
nonblocking connects so you know when the remote connection accepted the
lib/IO/EventMux.pm view on Meta::CPAN
}
}
=head2 B<socket_creds($fh)>
Return credentials on UNIX domain sockets.
=cut
sub socket_creds {
my ($self, $fh) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
@fds=();
close $c; undef $c;
undef $p->received_fds; # closes received fds
SKIP: {
skip "Peer credentials are supported on Linux only", 1
unless( $^O=~/linux/i );
cmp_deeply [$p->peercred], [$$, $>, ($)=~/(\d+)/)[0]], 'peer credentials';
}
} else {
@to_be_deleted=();
close $p; undef $p;
view all matches for this distribution
view release on metacpan or search on metacpan
xt/stress.t view on Meta::CPAN
# eval connection parameters into existance
my $ok = do $conf_file;
defined $ok or die "Error loading $conf_file: ", $@||$!;
unless (defined $db) {
die "Need mysql credentials for this";
}
}
my %args = (
type => 'MySQL',
view all matches for this distribution
view release on metacpan or search on metacpan
Door/Server.pm view on Meta::CPAN
=head2 SPECIAL VARIABLES
When an C<IPC::Door::Client> process makes a call, the
C<IPC::Door::Server> process sets 5 special variables as a result of
C<door_cred>/C<doore_ucred> (3DOOR) call.
These corresponds to self-explanatory credentials of the client process:
C<$IPC::Door::CLIENT_EUID>,
C<$IPC::Door::CLIENT_EGID>,
C<$IPC::Door::CLIENT_RUID>,
C<$IPC::Door::CLIENT_RGID>, and
C<$IPC::Door::CLIENT_PID>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPCamera/Reolink.pm view on Meta::CPAN
}else{
return 1; # Login token still valid
} # if
} # _checkLoginLeaseTime()
# Login() - provides login credentials (username/password) to camera and returns API access token good for specified number of seconds
sub Login(){
my($self) = @_;
my($_camera_rest_client, $camera_url, $camera_user_name, $camera_password, $camera_X509_certificate_file, $camera_X509_key_file, $camera_certificate_authority_file, $_is_https) = ($self->{_camera_rest_client}, $self->{camera_url}, $self->{camera_...
if(!defined($_camera_rest_client)){
# disable check for valid certificate matching the expected hostname
lib/IPCamera/Reolink.pm view on Meta::CPAN
print STDERR scalar(localtime()) . ": error: Camera Login for user '" . $self->{camera_user_name} . "' failed\n" if($DEBUG > 0);
return (undef, undef);
} # if
} # Login()
# Logout() - release login credentials from previous Login()
sub Logout(){
my($self) = @_;
my($_camera_rest_client, $_camera_login_token) = ($self->{_camera_rest_client}, $self->{_camera_login_token});
if(defined($_camera_rest_client)){
$self->{_camera_login_token} = undef;
lib/IPCamera/Reolink.pm view on Meta::CPAN
my $camera = IPCamera::Reolink->new($camera_url, $camera_user_name, $camera_password);
# or
# my $camera = IPCamera::Reolink->new( {camera_url => $camera_url_http, camera_user_name => $camera_user_name, camera_password => $camera_password, camera_x509_certificate_file => undef, camera_x509_key_file => undef, camera_certificate_authority_fi...
# Optionally Login to the camera immmediately to validate the camera URL and credentials, otherwise a Login will be implicitly performed by the API on the first camera command.
die "IPCamera::Reolink::Login failed" if(!$camera->Login());
# Some camera info
lib/IPCamera/Reolink.pm view on Meta::CPAN
=back
=head2 Login()
Login to the camera using the credentials provided to new() (above).
Upon successful Login the camera passes back a Login token and lease time that is used internally by other IPCamera::Reolink camera API methods.
The token is valid for the specified lease time.
lib/IPCamera/Reolink.pm view on Meta::CPAN
=back
=head2 Logout()
Release Login() credentials.
=over 4
=item return
lib/IPCamera/Reolink.pm view on Meta::CPAN
=head2 StartZoomFocus($camera_channel, $camera_operation, $camera_zoom_pos|$camera_focus_pos)
Set camera current Zoom or Focus value.
Note that the current version of the firmware on the authors camera (Firmware Version v3.1.0.2347_23061923_v1.0.0.93) requires a Login() using admin credentials to use this function.
According to Reolink this may be fixed in a future firmware version.
If in doubt, set $DEBUG to 1 and if you see a log message of the form:
Tue Dec 19 18:17:07 2023: debug: IPCamera::Reolink::_sendCameraCommand(): command 'StartZoomFocus' token '5b34aab0bb481ba' request '[{ action => 0, cmd => "StartZoomFocus", param => { ZoomFocus => { channel => 0, op => "ZoomPos", pos => 1 } } }]' res...
then you need to use admin credentials to use this function.
=over 4
=item return
lib/IPCamera/Reolink.pm view on Meta::CPAN
Set camera On Screen Display (OSD) values.
Note that the current version of the firmware on the authors camera
(Firmware Version v3.1.0.2347_23061923_v1.0.0.93) requires a Login()
using admin credentials to use this function.
=over 4
=item return
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IPDevice/Allnet/ALL4000.pm view on Meta::CPAN
}
$self->{URL} = "http://$self->{HOST}:$self->{PORT}/xml";
my $ua = LWP::UserAgent->new;
$ua->credentials("$self->{HOST}:$self->{PORT}", "ALL4000", $self->{USERNAME}, $self->{PASSWORD} );
$self->{UA} = $ua;
my $parser = new XML::Parser(Style => 'Tree');
$parser->setHandlers( Start => \&_start_handler,
Final => \&_final_handler,
view all matches for this distribution