Skip to content

Commit

Permalink
More verbose for password and client_credentials debug page.
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Jun 24, 2014
1 parent 37cf9e8 commit f93bfb5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions app/config/routing_prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@
'state' => $app['session']->getId(),
));

$ropcg_path = $app['url_generator']->generate('grant_type_password');
$ccg_path = $app['url_generator']->generate('grant_type_client_credentials');
$ropcg_path = $app['url_generator']->generate('grant_type_password', array(
'username' => 'demousername1',
'password' => 'demopassword1',
));
$ccg_path = $app['url_generator']->generate('grant_type_client_credentials', array(
'client_id' => 'ccg',
'client_secret' => 'yib6aiFe',
));

return $app['twig']->render('index.html.twig', array(
'acg_http_path' => $acg_http_path,
Expand Down Expand Up @@ -177,8 +183,8 @@
$app->get('/grant_type/password', function (Request $request, Application $app) {
$parameters = array(
'grant_type' => 'password',
'username' => 'demousername1',
'password' => 'demopassword1',
'username' => $request->query->get('username'),
'password' => $request->query->get('password'),
'scope' => 'demoscope1',
'state' => $app['session']->getId(),
);
Expand Down Expand Up @@ -216,8 +222,8 @@
'scope' => 'demoscope1',
);
$server = array(
'PHP_AUTH_USER' => 'ccg',
'PHP_AUTH_PW' => 'yib6aiFe',
'PHP_AUTH_USER' => $request->query->get('client_id'),
'PHP_AUTH_PW' => $request->query->get('client_secret'),
);
$client = new Client($app);
$crawler = $client->request('POST', '/oauth2/token', $parameters, array(), $server);
Expand Down

0 comments on commit f93bfb5

Please sign in to comment.