1
1
<?php
2
+ namespace OAuth2 \Server ;
3
+
2
4
/**
3
5
*
4
6
*
5
7
*
6
8
* @category OAuth2
7
9
* @package OAuth2
8
10
*/
9
- namespace OAuth2 \ Server ;
10
- use ReflectionClass ,
11
- Zend_Uri_Http ,
12
- OAuth2 \Exception \ServerException ,
13
- OAuth2 \Exception \AuthenticateException ,
14
- OAuth2 \Exception \ RedirectException ,
15
- OAuth2 \Grant \GrantCodeInterface ,
16
- OAuth2 \Grant \GrantUserInterface ,
17
- OAuth2 \Grant \GrantClientInterface ,
18
- OAuth2 \Grant \GrantImplicitInterface ,
19
- OAuth2 \Grant \ GrantExtensionInterface ,
20
- OAuth2 \RefreshTokensInterface ,
21
- OAuth2 \ Storage \ StorageInterface ;
11
+ use ReflectionClass ;
12
+ use Zend_Uri_Http ;
13
+ use OAuth2 \ Exception \ ServerException ;
14
+ use OAuth2 \Exception \AuthenticateException ;
15
+ use OAuth2 \Exception \RedirectException ;
16
+ use OAuth2 \Grant \ GrantCodeInterface ;
17
+ use OAuth2 \Grant \GrantUserInterface ;
18
+ use OAuth2 \Grant \GrantClientInterface ;
19
+ use OAuth2 \Grant \GrantImplicitInterface ;
20
+ use OAuth2 \Grant \GrantExtensionInterface ;
21
+ use OAuth2 \RefreshTokensInterface ;
22
+ use OAuth2 \Storage \ StorageInterface ;
23
+
22
24
/**
23
25
* @category OAuth2
24
26
* @package OAuth2
47
49
*
48
50
* @see http://code.google.com/p/oauth2-php/
49
51
* @see https://github.com/quizlet/oauth2-php
50
- */
51
-
52
- /**
52
+ *
53
53
* Server.0 draft v20 server-side implementation.
54
54
*
55
55
* @todo Add support for Message Authentication Code (MAC) token type.
@@ -627,7 +627,7 @@ public function getBearerToken() {
627
627
*
628
628
* @ingroup oauth2_section_7
629
629
*/
630
- private function checkScope ($ required_scope , $ available_scope ) {
630
+ protected function checkScope ($ required_scope , $ available_scope ) {
631
631
// The required scope should match or be a subset of the available scope
632
632
if (!is_array ($ required_scope )) {
633
633
$ required_scope = explode (' ' , trim ($ required_scope ));
@@ -1091,7 +1091,7 @@ public function finishClientAuthorization($is_authorized, $user_id = null, $para
1091
1091
*
1092
1092
* @ingroup oauth2_section_4
1093
1093
*/
1094
- private function doRedirectUriCallback ($ redirect_uri , $ params ) {
1094
+ protected function doRedirectUriCallback ($ redirect_uri , $ params ) {
1095
1095
header ("HTTP/1.1 " . self ::HTTP_FOUND );
1096
1096
header ("Location: " . $ this ->buildUri ($ redirect_uri , $ params ));
1097
1097
exit ();
@@ -1110,7 +1110,7 @@ private function doRedirectUriCallback($redirect_uri, $params) {
1110
1110
*
1111
1111
* @ingroup oauth2_section_4
1112
1112
*/
1113
- private function buildUri ($ uri , $ params ) {
1113
+ protected function buildUri ($ uri , $ params ) {
1114
1114
$ uri = Zend_Uri_Http::fromString ($ uri );
1115
1115
$ uri ->setQuery ($ params ['fragment ' ]);
1116
1116
foreach ( $ params as $ k => $ v ) {
@@ -1175,7 +1175,7 @@ protected function createAccessToken($client_id, $user_id, $scope = null) {
1175
1175
*
1176
1176
* @ingroup oauth2_section_4
1177
1177
*/
1178
- private function createAuthCode ($ client_id , $ user_id , $ redirect_uri , $ scope = null ) {
1178
+ protected function createAuthCode ($ client_id , $ user_id , $ redirect_uri , $ scope = null ) {
1179
1179
$ code = $ this ->genAuthCode ();
1180
1180
$ this ->storage ->setAuthCode ($ code , $ client_id , $ user_id , $ redirect_uri , time () + $ this ->getVariable (self ::CONFIG_AUTH_LIFETIME ), $ scope );
1181
1181
return $ code ;
@@ -1249,7 +1249,7 @@ protected function getAuthorizationHeader() {
1249
1249
*
1250
1250
* @ingroup oauth2_section_5
1251
1251
*/
1252
- private function sendJsonHeaders () {
1252
+ protected function sendJsonHeaders () {
1253
1253
if (php_sapi_name () === 'cli ' || headers_sent ()) {
1254
1254
return ;
1255
1255
}
0 commit comments