1 | <?php namespace Arcanedev\Socialite\Base; |
||
15 | abstract class OAuthOneProvider implements Provider |
||
16 | { |
||
17 | /* ------------------------------------------------------------------------------------------------ |
||
18 | | Properties |
||
19 | | ------------------------------------------------------------------------------------------------ |
||
20 | */ |
||
21 | /** |
||
22 | * The HTTP request instance. |
||
23 | * |
||
24 | * @var \Illuminate\Http\Request |
||
25 | */ |
||
26 | protected $request; |
||
27 | |||
28 | /** |
||
29 | * The OAuth server implementation. |
||
30 | * |
||
31 | * @var \League\OAuth1\Client\Server\Server |
||
32 | */ |
||
33 | protected $server; |
||
34 | |||
35 | /* ------------------------------------------------------------------------------------------------ |
||
36 | | Constructor |
||
37 | | ------------------------------------------------------------------------------------------------ |
||
38 | */ |
||
39 | /** |
||
40 | * Create a new provider instance. |
||
41 | * |
||
42 | * @param \Illuminate\Http\Request $request |
||
43 | * @param \League\OAuth1\Client\Server\Server $server |
||
44 | */ |
||
45 | public function __construct(Request $request, Server $server) |
||
50 | |||
51 | /* ------------------------------------------------------------------------------------------------ |
||
52 | | Getters & Setters |
||
53 | | ------------------------------------------------------------------------------------------------ |
||
54 | */ |
||
55 | /** |
||
56 | * Set the request instance. |
||
57 | * |
||
58 | * @param \Illuminate\Http\Request $request |
||
59 | * |
||
60 | * @return self |
||
61 | */ |
||
62 | public function setRequest(Request $request) |
||
68 | |||
69 | /* ------------------------------------------------------------------------------------------------ |
||
70 | | Main Functions |
||
71 | | ------------------------------------------------------------------------------------------------ |
||
72 | */ |
||
73 | /** |
||
74 | * Redirect the user to the authentication page for the provider. |
||
75 | * |
||
76 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
||
77 | */ |
||
78 | public function redirect() |
||
86 | |||
87 | /** |
||
88 | * Get the User instance for the authenticated user. |
||
89 | * |
||
90 | * @throws \InvalidArgumentException |
||
91 | * |
||
92 | * @return \Arcanedev\Socialite\OAuth\One\User |
||
93 | */ |
||
94 | public function user() |
||
114 | |||
115 | /* ------------------------------------------------------------------------------------------------ |
||
116 | | Other Functions |
||
117 | | ------------------------------------------------------------------------------------------------ |
||
118 | */ |
||
119 | /** |
||
120 | * Get the token credentials for the request. |
||
121 | * |
||
122 | * @return \League\OAuth1\Client\Credentials\TokenCredentials |
||
123 | */ |
||
124 | protected function getToken() |
||
132 | |||
133 | /** |
||
134 | * Determine if the request has the necessary OAuth verifier. |
||
135 | * |
||
136 | * @return bool |
||
137 | */ |
||
138 | protected function hasNecessaryVerifier() |
||
142 | } |
||
143 |