1 | <?php |
||
21 | class Oauth extends Controller |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Oauth model instance |
||
26 | * @var \gplcart\modules\oauth\models\Oauth $oauth |
||
27 | */ |
||
28 | protected $oauth; |
||
29 | |||
30 | /** |
||
31 | * The current Oauth provider |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $data_provider; |
||
35 | |||
36 | /** |
||
37 | * A code received from a provider |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $data_code; |
||
41 | |||
42 | /** |
||
43 | * A state hash received from a provider |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $data_state; |
||
47 | |||
48 | /** |
||
49 | * An array of data parsed from a received state |
||
50 | * @var array |
||
51 | */ |
||
52 | protected $data_decoded_state; |
||
53 | |||
54 | /** |
||
55 | * An array of token data |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $data_token; |
||
59 | |||
60 | /** |
||
61 | * A processed authorization result |
||
62 | * @var mixed |
||
63 | */ |
||
64 | protected $data_result; |
||
65 | |||
66 | /** |
||
67 | * @param OauthModel $oauth |
||
68 | */ |
||
69 | public function __construct(OauthModel $oauth) |
||
75 | |||
76 | /** |
||
77 | * Callback for Oauth returning URL |
||
78 | */ |
||
79 | public function callbackOauth() |
||
92 | |||
93 | /** |
||
94 | * Set and validates received data from Oauth provider |
||
95 | * @throws InvalidArgumentException |
||
96 | */ |
||
97 | protected function setResponseOauth() |
||
120 | |||
121 | /** |
||
122 | * Does final redirect after authorization |
||
123 | */ |
||
124 | protected function redirectOauth() |
||
136 | |||
137 | /** |
||
138 | * Set received token data |
||
139 | * @throws OutOfRangeException |
||
140 | */ |
||
141 | protected function setTokenOauth() |
||
146 | |||
147 | /** |
||
148 | * Set authorization result |
||
149 | */ |
||
150 | protected function setResultOauth() |
||
163 | |||
164 | } |
||
165 |