@@ -31,9 +31,9 @@ public function getAuthorizeResponse($params, $user_id = null)
3131 // build the URL to redirect to
3232 $ result = array ('query ' => array ());
3333
34- $ params += array ('scope ' => null , 'state ' => null , 'id_token ' => null );
34+ $ params += array ('scope ' => null , 'state ' => null , 'id_token ' => null , ' code_challenge ' => null , ' code_challenge_method ' => null );
3535
36- $ result ['query ' ]['code ' ] = $ this ->createAuthorizationCode ($ params ['client_id ' ], $ user_id , $ params ['redirect_uri ' ], $ params ['scope ' ], $ params ['id_token ' ]);
36+ $ result ['query ' ]['code ' ] = $ this ->createAuthorizationCode ($ params ['client_id ' ], $ user_id , $ params ['redirect_uri ' ], $ params ['scope ' ], $ params ['id_token ' ], $ params [ ' code_challenge ' ], $ params [ ' code_challenge_method ' ] );
3737
3838 if (isset ($ params ['state ' ])) {
3939 $ result ['query ' ]['state ' ] = $ params ['state ' ];
@@ -56,10 +56,10 @@ public function getAuthorizeResponse($params, $user_id = null)
5656 * @see http://tools.ietf.org/html/rfc6749#section-4
5757 * @ingroup oauth2_section_4
5858 */
59- public function createAuthorizationCode ($ client_id , $ user_id , $ redirect_uri , $ scope = null , $ id_token = null )
59+ public function createAuthorizationCode ($ client_id , $ user_id , $ redirect_uri , $ scope = null , $ id_token = null , $ code_challenge = null , $ code_challenge_method = null )
6060 {
6161 $ code = $ this ->generateAuthorizationCode ();
62- $ this ->storage ->setAuthorizationCode ($ code , $ client_id , $ user_id , $ redirect_uri , time () + $ this ->config ['auth_code_lifetime ' ], $ scope , $ id_token );
62+ $ this ->storage ->setAuthorizationCode ($ code , $ client_id , $ user_id , $ redirect_uri , time () + $ this ->config ['auth_code_lifetime ' ], $ scope , $ id_token, $ code_challenge , $ code_challenge_method );
6363
6464 return $ code ;
6565 }
0 commit comments