diff --git a/lib/NGCP/BulkProcessor/Downloaders/EWS/Client.pm b/lib/NGCP/BulkProcessor/Downloaders/EWS/Client.pm index 9a2e06c..915fe7c 100644 --- a/lib/NGCP/BulkProcessor/Downloaders/EWS/Client.pm +++ b/lib/NGCP/BulkProcessor/Downloaders/EWS/Client.pm @@ -26,14 +26,14 @@ use Log::Report; has username => ( is => 'rw', - isa => 'Str', - required => 1, + isa => 'Maybe[Str]', + required => 0, ); has password => ( is => 'rw', - isa => 'Str', - required => 1, + isa => 'Maybe[Str]', + required => 0, ); has server => ( @@ -109,8 +109,7 @@ sub BUILD { if ($self->username =~ m/(.+)@(.+)/) { $self->username( $2 .'\\'. $1 ); } - } - else { + } else { # URI escape the username and password $self->password( URI::Escape::uri_escape($self->password) ); $self->username( URI::Escape::uri_escape($self->username) ); diff --git a/lib/NGCP/BulkProcessor/Downloaders/EWS/Client/Role/SOAP.pm b/lib/NGCP/BulkProcessor/Downloaders/EWS/Client/Role/SOAP.pm index 5611f44..18bb279 100644 --- a/lib/NGCP/BulkProcessor/Downloaders/EWS/Client/Role/SOAP.pm +++ b/lib/NGCP/BulkProcessor/Downloaders/EWS/Client/Role/SOAP.pm @@ -1,6 +1,7 @@ package EWS::Client::Role::SOAP; use strict; use warnings; + BEGIN { $EWS::Client::Role::SOAP::VERSION = '1.143070'; } @@ -57,7 +58,7 @@ sub _build_transporter { my $self = shift; my $addr = $self->server . '/EWS/Exchange.asmx'; - if (not $self->use_negotiated_auth) { + if (not $self->use_negotiated_auth and $self->username) { $addr = sprintf '%s:%s@%s', $self->username, $self->password, $addr; } @@ -124,8 +125,8 @@ sub _create_oauth_ua { my $self = shift; - my $tenant_id = $self->tenand_id; - return unless $tenant_id; + my $tenant_id = $self->tenant_id; + return unless $tenant_id; #https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize? #client_id=6731de76-14a6-49ae-97bc-6eba6914391e @@ -191,7 +192,7 @@ sub _create_oauth_ua { sub save_tokens { my ($token_string) = @_; - print "token:" . $token_string; + #print "token:" . $token_string; } no Moose::Role;