blob: edbcec4b52ebbc20c4433c1adb6cd39d1d8eab01 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<?php
namespace Wallabag\CoreBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DeveloperController extends Controller
{
/**
* @param Request $request
*
* @Route("/developer", name="developer")
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function indexAction(Request $request)
{
return $this->render('WallabagCoreBundle:Developer:index.html.twig');
}
/**
* @param Request $request
*
* @Route("/developer/client/create", name="create_client")
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function createClientAction(Request $request)
{
$clientManager = $this->container->get('fos_oauth_server.client_manager.default');
$client = $clientManager->createClient();
$client->setRedirectUris(array('http://www.example.com'));
$client->setAllowedGrantTypes(array('token', 'authorization_code'));
$clientManager->updateClient($client);
return $this->render('WallabagCoreBundle:Developer:client.html.twig', array(
'client_id' => $client->getPublicId(),
'client_secret' => $client->getSecret(),
));
}
/**
* @param Request $request
*
* @Route("/developer/howto/first-app", name="howto-firstapp")
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function howtoFirstAppAction(Request $request)
{
return $this->render('WallabagCoreBundle:Developer:howto_app.html.twig');
}
}
|