1 | <?php |
||
23 | class SocialAuthenticate extends BaseAuthenticate |
||
24 | { |
||
25 | |||
26 | const TYPE_QUERYSTRING = 'querystring'; |
||
27 | const TYPE_HEADER = 'header'; |
||
28 | |||
29 | public $types = [self::TYPE_QUERYSTRING, self::TYPE_HEADER]; |
||
30 | |||
31 | protected $_defaultConfig = [ |
||
32 | //type, can be either querystring or header |
||
33 | 'type' => self::TYPE_QUERYSTRING, |
||
34 | //name to retrieve the provider value from |
||
35 | 'provider_name' => 'provider', |
||
36 | //name to retrieve the token value from |
||
37 | 'token_name' => 'token', |
||
38 | //name to retrieve the token secret value from |
||
39 | 'token_secret_name' => 'token_secret', |
||
40 | //db table where the key is stored |
||
41 | 'table' => 'CakeDC/Users.SocialAccounts', |
||
42 | //db table where the key is stored |
||
43 | 'userModel' => 'CakeDC/Users.Users', |
||
44 | //db field where the provider is stored |
||
45 | 'provider_field' => 'provider', |
||
46 | //db field where the token is stored |
||
47 | 'token_field' => 'token', |
||
48 | //db field where the token secret is stored |
||
49 | 'token_secret_field' => 'token_secret', |
||
50 | //require SSL to pass the token. You should always require SSL to use tokens for Auth |
||
51 | 'require_ssl' => true, |
||
52 | //finder for social accounts, |
||
53 | 'finder' => 'active' |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * Authenticate callback |
||
58 | * Reads the Api Key based on configuration and login the user |
||
59 | * |
||
60 | * @param Request $request Cake request object. |
||
61 | * @param Response $response Cake response object. |
||
62 | * @return mixed |
||
63 | */ |
||
64 | public function authenticate(Request $request, Response $response) |
||
68 | |||
69 | /** |
||
70 | * Stateless Authentication System |
||
71 | * |
||
72 | * @param Request $request Cake request object. |
||
73 | * @return mixed |
||
74 | */ |
||
75 | public function getUser(Request $request) |
||
111 | |||
112 | /** |
||
113 | * Get query object for fetching user from database. |
||
114 | * |
||
115 | * @param string $provider |
||
116 | * @param $token |
||
117 | * @param $tokenSecret |
||
118 | * @return \Cake\ORM\Query |
||
119 | */ |
||
120 | protected function _socialQuery($provider, $token, $tokenSecret) |
||
132 | |||
133 | /** |
||
134 | * Get the api key from the querystring |
||
135 | * |
||
136 | * @param Request $request request |
||
137 | * @return string api key |
||
138 | */ |
||
139 | public function querystring(Request $request) |
||
147 | |||
148 | /** |
||
149 | * Get the api key from the header |
||
150 | * |
||
151 | * @param Request $request request |
||
152 | * @return string api key |
||
153 | */ |
||
154 | public function header(Request $request) |
||
162 | } |
||
163 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.