forked from mintbridge/kohana-oauth
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Woody Gilk
committed
Dec 17, 2011
1 parent
beb5bf4
commit 27b17f2
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php defined('SYSPATH') OR die('No direct access allowed.'); | ||
|
||
abstract class Kohana_OAuth2_Provider_Mailchimp extends OAuth2_Provider { | ||
|
||
public $name = 'mailchimp'; | ||
|
||
public function url_authorize() | ||
{ | ||
return 'https://login.mailchimp.com/oauth2/authorize'; | ||
} | ||
|
||
public function url_access_token() | ||
{ | ||
return 'https://login.mailchimp.com/oauth2/token'; | ||
} | ||
|
||
public function url_metadata() | ||
{ | ||
return 'https://login.mailchimp.com/oauth2/metadata'; | ||
} | ||
|
||
public function metadata(OAuth2_Token_Access $token, array $params = NULL) | ||
{ | ||
$request = OAuth2_Request::factory('resource', 'GET', $this->url_metadata(), array( | ||
'access_token' => $token->token, | ||
)) | ||
->required('access_token', TRUE) | ||
; | ||
|
||
if ($params) | ||
{ | ||
// Load user parameters | ||
$request->params($params); | ||
} | ||
|
||
return $this->execute($request); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
class OAuth2_Provider_MailChimp extends Kohana_OAuth2_Provider_MailChimp { } |