Skip to content

Commit

Permalink
Added MailChimp provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Woody Gilk committed Dec 17, 2011
1 parent beb5bf4 commit 27b17f2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
39 changes: 39 additions & 0 deletions classes/kohana/oauth2/provider/mailchimp.php
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);
}

}
3 changes: 3 additions & 0 deletions classes/oauth2/provider/mailchimp.php
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 { }

0 comments on commit 27b17f2

Please sign in to comment.