« blib/lib/LWP/Authen/OAuth2/ServiceProvider/Withings.pm
↑ Summary
lib/LWP/Authen/OAuth2/ServiceProvider/Line/AccessToken.pm »
| 1 | package LWP::Authen::OAuth2::ServiceProvider::Yahoo; | ||
| 2 | |||
| 3 | # ABSTRACT: Access Yahoo using OAuth2 | ||
| 4 | our $VERSION = '0.19'; # VERSION | ||
| 5 | |||
| 6 | our @ISA = qw(LWP::Authen::OAuth2::ServiceProvider); | ||
| 7 | |||
| 8 | sub authorization_endpoint { | ||
| 9 | return "https://api.login.yahoo.com/oauth2/request_auth"; | ||
| 10 | } | ||
| 11 | |||
| 12 | sub token_endpoint { | ||
| 13 | return "https://api.login.yahoo.com/oauth2/get_token"; | ||
| 14 | } | ||
| 15 | |||
| 16 | sub authorization_required_params { | ||
| 17 | my $self = shift; | ||
| 18 | return ("client_id", "redirect_uri", "response_type", $self->SUPER::authorization_required_params()); | ||
| 19 | } | ||
| 20 | |||
| 21 | sub authorization_optional_params { | ||
| 22 | my $self = shift; | ||
| 23 | return ("state", "language", $self->SUPER::authorization_optional_params()); | ||
| 24 | } | ||
| 25 | |||
| 26 | sub refresh_required_params { | ||
| 27 | my $self = shift; | ||
| 28 | return ("client_id", "client_secret", "redirect_uri", "grant_type", $self->SUPER::refresh_required_params()); | ||
| 29 | } | ||
| 30 | |||
| 31 | sub request_required_params { | ||
| 32 | my $self = shift; | ||
| 33 | return ("client_id", "client_secret", "redirect_uri", "grant_type", $self->SUPER::request_required_params()); | ||
| 34 | } | ||
| 35 | |||
| 36 | sub authorization_default_params { | ||
| 37 | my $self = shift; | ||
| 38 | return ("response_type" => "code", $self->SUPER::authorization_default_params()); | ||
| 39 | } | ||
| 40 | |||
| 41 | sub request_default_params { | ||
| 42 | my $self = shift; | ||
| 43 | return ("grant_type" => "authorization_code", $self->SUPER::request_default_params()); | ||
| 44 | } | ||
| 45 | |||
| 46 | sub refresh_default_params { | ||
| 47 | my $self = shift; | ||
| 48 | return ("grant_type" => "refresh_token", $self->SUPER::refresh_default_params()); | ||
| 49 | } | ||
| 50 | |||
| 51 | 1; | ||
| 52 | |||
| 53 | __END__ |