PHP code example of hicmait / oauth2-server-bundle
1. Go to this page and download the library: Download hicmait/oauth2-server-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hicmait / oauth2-server-bundle example snippets
php
public function tokenAction()
{
$server = $this->get('oauth2.server');
// Override default grant types to authorization code only
$server->addGrantType($this->get('oauth2.grant_type.authorization_code'));
return $server->handleTokenRequest($this->get('oauth2.request'), $this->get('oauth2.response'));
}
bash
$ php composer.phar
php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new OAuth2\ServerBundle\OAuth2ServerBundle(),
);
}