<commit_before><?php

namespace Ms\OauthBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Ms\OauthBundle\Component\Authorization\AuthorizationRequest;
use Ms\OauthBundle\Entity\AuthorizationCodeScope;
use Ms\OauthBundle\Component\Authorization\AuthorizationResponseType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Ms\OauthBundle\Component\Authorization\AccessTokenRequest;
use Buzz\Message\MessageInterface;

/**
 * Description of ClientController
 *
 * @author Marios
 */
class ClientController extends Controller {
    
    /**@#+
     *
     * @var string
     */
    private static $CLIENT_ID= 'zMuobKhbnvJUTYc+EnXfRwiiHP4/OpmM5CLrdpkIsm4';
    private static $REDIRECTION_URI = 'http://msoauthphp.local/app_dev.php/client-app/demo1';
    private static $PASSWORD = '<PASSWORD>=';
    private static $STATE = 'RdoTKJnaUxdRfE7QBTZX';
    /**@#-*/

    /**
     * 
     * @return Response
     */
    public function demo1Action(Request $request) {
        if ($this->isAuthorizationCodeResponse($request)) {
            return $this->exchangeCodeForToken($request->query->get('code'));
        }
//        if ($this->isAccessTokenResponse($request)) {
//            return new Response('Access token granted!');
//        }
        
        $request = new AuthorizationRequest(AuthorizationRequest::SERVER_URI);
        $request->addScope(AuthorizationCodeScope::BASIC);
        $request->setClientId(static::$CLIENT_ID);
        $request->setRedirectionUri(static::$REDIRECTION_URI);<commit_msg>Update the "client secret" in the ClientController class.<commit_after><?php

namespace Ms\OauthBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Ms\OauthBundle\Component\Authorization\AuthorizationRequest;
use Ms\OauthBundle\Entity\AuthorizationCodeScope;
use Ms\OauthBundle\Component\Authorization\AuthorizationResponseType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Ms\OauthBundle\Component\Authorization\AccessTokenRequest;
use Buzz\Message\MessageInterface;

/**
 * Description of ClientController
 *
 * @author Marios
 */
class ClientController extends Controller {
    
    /**@#+
     *
     * @var string
     */
    private static $CLIENT_ID= 'zMuobKhbnvJUTYc+EnXfRwiiHP4/OpmM5CLrdpkIsm4';
    private static $REDIRECTION_URI = 'http://msoauthphp.local/app_dev.php/client-app/demo1';
    private static $PASSWORD = '<PASSWORD>=';
    private static $STATE = 'RdoTKJnaUxdRf<PASSWORD>BTZX';
    /**@#-*/

    /**
     * 
     * @return Response
     */
    public function demo1Action(Request $request) {
        if ($this->isAuthorizationCodeResponse($request)) {
            return $this->exchangeCodeForToken($request->query->get('code'));
        }
//        if ($this->isAccessTokenResponse($request)) {
//            return new Response('Access token granted!');
//        }
        
        $request = new AuthorizationRequest(AuthorizationRequest::SERVER_URI);
        $request->addScope(AuthorizationCodeScope::BASIC);
        $request->setClientId(static::$CLIENT_ID);
        $request->setRedirectionUri(static::$REDIRECTION_URI);
{'fraction_non_alphanumeric': 0.12449549829245576, 'fraction_numerical': 0.0034150884818379386, 'mean_word_length': 3.8744326777609683, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6074662', 'n_tokens_mistral': 942, 'n_tokens_neox': 949, 'n_words': 144}