1 | <?php declare(strict_types=1); |
||
26 | abstract class OAuthRedirectException extends OAuthServerException |
||
27 | { |
||
28 | /** |
||
29 | * Error code. |
||
30 | * |
||
31 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
32 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
33 | */ |
||
34 | const ERROR_INVALID_REQUEST = 'invalid_request'; |
||
35 | |||
36 | /** |
||
37 | * Error code. |
||
38 | * |
||
39 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
40 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
41 | */ |
||
42 | const ERROR_UNAUTHORIZED_CLIENT = 'unauthorized_client'; |
||
43 | |||
44 | /** |
||
45 | * Error code. |
||
46 | * |
||
47 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
48 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
49 | */ |
||
50 | const ERROR_ACCESS_DENIED = 'access_denied'; |
||
51 | |||
52 | /** |
||
53 | * Error code. |
||
54 | * |
||
55 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
56 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
57 | */ |
||
58 | const ERROR_UNSUPPORTED_RESPONSE_TYPE = 'unsupported_response_type'; |
||
59 | |||
60 | /** |
||
61 | * Error code. |
||
62 | * |
||
63 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
64 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
65 | */ |
||
66 | const ERROR_INVALID_SCOPE = 'invalid_scope'; |
||
67 | |||
68 | /** |
||
69 | * Error code. |
||
70 | * |
||
71 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
72 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
73 | */ |
||
74 | const ERROR_SERVER_ERROR = 'server_error'; |
||
75 | |||
76 | /** |
||
77 | * Error code. |
||
78 | * |
||
79 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
80 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
81 | */ |
||
82 | const ERROR_TEMPORARILY_UNAVAILABLE = 'temporarily_unavailable'; |
||
83 | |||
84 | /** |
||
85 | * Default error messages. The actual messages should be defined in child classes. |
||
86 | * |
||
87 | * @link https://tools.ietf.org/html/rfc6749#section-4.1.2.1 |
||
88 | * @link https://tools.ietf.org/html/rfc6749#section-4.2.2.1 |
||
89 | */ |
||
90 | const DEFAULT_MESSAGES = null; |
||
91 | |||
92 | /** |
||
93 | * @var string |
||
94 | */ |
||
95 | private $errorCode; |
||
96 | |||
97 | /** |
||
98 | * @var string |
||
99 | */ |
||
100 | private $redirectUri; |
||
101 | |||
102 | /** |
||
103 | * @var string|null |
||
104 | */ |
||
105 | private $errorUri; |
||
106 | |||
107 | /** |
||
108 | * @var null|string |
||
109 | */ |
||
110 | private $state; |
||
111 | |||
112 | /** |
||
113 | * @var string[] |
||
114 | */ |
||
115 | private $httpHeaders; |
||
116 | |||
117 | /** |
||
118 | * @param string $errorCode |
||
119 | * @param string $redirectUri |
||
120 | * @param string|null $state |
||
121 | * @param string|null $errorUri |
||
122 | * @param string[] $httpHeaders |
||
123 | * @param string[]|null $descriptions |
||
124 | 6 | * @param Exception|null $previous |
|
125 | */ |
||
126 | public function __construct( |
||
145 | |||
146 | /** |
||
147 | 6 | * @return string |
|
148 | */ |
||
149 | 6 | public function getErrorCode(): string |
|
153 | |||
154 | /** |
||
155 | 6 | * @return string |
|
156 | */ |
||
157 | 6 | public function getErrorDescription(): string |
|
161 | |||
162 | /** |
||
163 | 6 | * @return string |
|
164 | */ |
||
165 | 6 | public function getRedirectUri(): string |
|
169 | |||
170 | /** |
||
171 | 6 | * @return string|null |
|
172 | */ |
||
173 | 6 | public function getErrorUri(): ?string |
|
177 | |||
178 | /** |
||
179 | 6 | * @return null|string |
|
180 | */ |
||
181 | 6 | public function getState(): ?string |
|
185 | |||
186 | /** |
||
187 | 6 | * @return string[] |
|
188 | */ |
||
189 | 6 | public function getHttpHeaders(): array |
|
193 | } |
||
194 |