forked from mixu/useradmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linkedin.php
53 lines (46 loc) · 1.33 KB
/
linkedin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php defined('SYSPATH') or die('No direct script access.');
/**
* OAuth Linkedin Provider
*
* Documents for implementing Linkedin OAuth can be found at
* <https://developer.linkedin.com/documents/quick-start-guide>.
*
* [!!] This class does not implement the Linkedin API. It is only an
* implementation of standard OAuth with Linkedin as the service provider.
*
* @package Kohana/OAuth
* @category Provider
* @author Kohana Team
* @copyright (c) 2010 Kohana Team
* @license http://kohanaframework.org/license
* @since 3.0.7
*/
class Kohana_OAuth_Provider_Linkedin extends OAuth_Provider {
public $name = 'linkedin';
protected $signature = 'HMAC-SHA1';
public function url_request_token()
{
return 'https://api.linkedin.com/uas/oauth/requestToken';
}
public function url_authorize()
{
return 'https://api.linkedin.com/uas/oauth/authorize';
}
public function url_access_token()
{
return 'https://api.linkedin.com/uas/oauth/accessToken';
}
public function request_token(OAuth_Consumer $consumer, array $params = NULL)
{
if (empty($params))
{
$params = array();
}
$config = Kohana::$config->load('oauth.' . $this->name);
if ($scope = Arr::get($config, 'scope'))
{
$params['scope'] = $scope;
}
return parent::request_token($consumer, $params);
}
} // End Kohana_OAuth_Provider_Linkedin