|
Lines 31-38
use Data::Dumper;
Link Here
|
| 31 |
|
31 |
|
| 32 |
use parent qw(WebService::ILS::OverDrive); |
32 |
use parent qw(WebService::ILS::OverDrive); |
| 33 |
|
33 |
|
| 34 |
use constant CIRCULATION_API_URL => "http://patron.api.overdrive.com/"; |
34 |
use constant CIRCULATION_API_URL => "https://patron.api.overdrive.com/"; |
| 35 |
use constant TEST_CIRCULATION_API_URL => "http://integration-patron.api.overdrive.com/"; |
35 |
use constant TEST_CIRCULATION_API_URL => "https://integration-patron.api.overdrive.com/"; |
| 36 |
use constant OAUTH_BASE_URL => "https://oauth.overdrive.com/"; |
36 |
use constant OAUTH_BASE_URL => "https://oauth.overdrive.com/"; |
| 37 |
use constant TOKEN_URL => OAUTH_BASE_URL . 'token'; |
37 |
use constant TOKEN_URL => OAUTH_BASE_URL . 'token'; |
| 38 |
use constant AUTH_URL => OAUTH_BASE_URL . 'auth'; |
38 |
use constant AUTH_URL => OAUTH_BASE_URL . 'auth'; |
|
Lines 123-129
An example:
Link Here
|
| 123 |
client_secret => $client_secret, |
123 |
client_secret => $client_secret, |
| 124 |
library_id => $library_id, |
124 |
library_id => $library_id, |
| 125 |
}); |
125 |
}); |
| 126 |
my $redirect_url = $overdrive->auth_url("http://myapp.com/overdrive-auth"); |
126 |
my $redirect_url = $overdrive->auth_url("https://myapp.com/overdrive-auth"); |
| 127 |
$response->redirect($redirect_url); |
127 |
$response->redirect($redirect_url); |
| 128 |
... |
128 |
... |
| 129 |
/overdrive-auth handler: |
129 |
/overdrive-auth handler: |
|
Lines 253-259
sub make_access_token_request {
Link Here
|
| 253 |
$user_id, $self->password, $self->website_id, $self->authorization_name |
253 |
$user_id, $self->password, $self->website_id, $self->authorization_name |
| 254 |
); |
254 |
); |
| 255 |
} |
255 |
} |
| 256 |
|
256 |
|
| 257 |
die $self->ERROR_NOT_AUTHENTICATED."\n"; |
257 |
die $self->ERROR_NOT_AUTHENTICATED."\n"; |
| 258 |
} |
258 |
} |
| 259 |
|
259 |
|
|
Lines 277-283
sub collection_token {
Link Here
|
| 277 |
if (my $collection_token = $self->SUPER::collection_token) { |
277 |
if (my $collection_token = $self->SUPER::collection_token) { |
| 278 |
return $collection_token; |
278 |
return $collection_token; |
| 279 |
} |
279 |
} |
| 280 |
|
280 |
|
| 281 |
$self->native_patron; # sets collection_token as a side-effect |
281 |
$self->native_patron; # sets collection_token as a side-effect |
| 282 |
my $collection_token = $self->SUPER::collection_token |
282 |
my $collection_token = $self->SUPER::collection_token |
| 283 |
or die "Patron has no collections\n"; |
283 |
or die "Patron has no collections\n"; |