Skip Menu |

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

Report information
The Basics
Id: 100832
Status: open
Priority: 0/
Queue: LWP-Authen-OAuth2

People
Owner: techman [...] cpan.org
Requestors: rjk [...] tamias.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.09
Fixed in: (no value)



Subject: Need ability to force token refresh
Currently, access tokens are refreshed based solely on the expires time in the token and the early refresh time in the LWP::Authen::OAuth2 object. I have a situation in which a remote server sometimes rejects an access token long before the expires time, and there seems to be no built-in way to force LWP::Authen::OAuth2 to refresh the token immediately.
Hi Ronald, A couple of use have recently taken over maintaining, so we're not fully familiar with the code base. That said, there appear to be 2 methods, one documented and one that doesn't appear to be. Documented: 'set_early_refresh_time' - You can set a number half or greater then the refresh time. Undocumented: 'refresh_access_token' Would either help? Leon
Subject: Re: [rt.cpan.org #100832] Need ability to force token refresh
Date: Mon, 15 Dec 2014 16:16:33 -0500
To: Leon Wright via RT <bug-LWP-Authen-OAuth2 [...] rt.cpan.org>
From: Ronald J Kimball <rjk [...] tamias.net>
Hi Leon, I've had situations where the access token needs to be refreshed after two hours of an eight expiration time (I'm not sure why), so 'set_early_refresh_time' doesn't work for me. Calling 'refresh_access_token' directly looks like it should work. I'll try that, thanks! Ronald
Ronald, How'd you get on with that? If it did what you expected I'll write some doco for it. I think we should allow people to refresh as often as they want, by default it shouldn't. But there are occasions like this that call for it. Regards, Leon