Skip Menu |

This queue is for tickets about the Net-OAuth2 CPAN distribution.

Report information
The Basics
Id: 88409
Status: resolved
Priority: 0/
Queue: Net-OAuth2

People
Owner: Nobody in particular
Requestors: chim [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.55
Fixed in: 0.57



Subject: wrong behaviour of the encode_base64
When get_access_token() adding header "Autorization Basic ..." it uses encode_base64() which has a feature to broke long encoded lines by 76 characters with delimeter "\n". So we get wrong header Authorization and get_access_token() fails when trying to request access_token from provider. There is a simple solution to resolve this issue. See attached patch.
Subject: encode_base64_issue.patch
diff -ur Net-OAuth2-0.55/lib/Net/OAuth2/Profile/WebServer.pm Net-OAuth2-0.55-1/lib/Net/OAuth2/Profile/WebServer.pm --- Net-OAuth2-0.55/lib/Net/OAuth2/Profile/WebServer.pm 2013-04-02 14:13:41.000000000 +0000 +++ Net-OAuth2-0.55-1/lib/Net/OAuth2/Profile/WebServer.pm 2013-09-04 09:28:13.000000000 +0000 @@ -87,7 +87,7 @@ , $params ); - my $basic = encode_base64 "$params->{client_id}:$params->{client_secret}"; + my $basic = encode_base64 "$params->{client_id}:$params->{client_secret}", ""; $request->headers->header(Authorization => "Basic $basic"); my $response = $self->request($request);
Subject: Re: [rt.cpan.org #88409] wrong behaviour of the encode_base64
Date: Wed, 4 Sep 2013 11:51:56 +0200
To: Anton Gerasimov via RT <bug-Net-OAuth2 [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Anton Gerasimov via RT (bug-Net-OAuth2@rt.cpan.org) [130904 09:42]: Show quoted text
> Wed Sep 04 05:42:23 2013: Request 88409 was acted upon. > Transaction: Ticket created by CHIM > Queue: Net-OAuth2 > Subject: wrong behaviour of the encode_base64 > Broken in: 0.55 > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=88409 > > > - my $basic = encode_base64 "$params->{client_id}:$params->{client_secret}"; > + my $basic = encode_base64 "$params->{client_id}:$params->{client_secret}", "";
Thanks. I will release 0.56 later today. -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net