-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #576 from dkarlovi/merge-1.6
Merge 1.6
- Loading branch information
Showing
27 changed files
with
514 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,6 @@ | |
use OAuth2\OAuth2; | ||
use OAuth2\OAuth2ServerException; | ||
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||
use Symfony\Component\Form\Form; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
@@ -39,12 +37,8 @@ | |
* | ||
* @author Chris Jones <[email protected]> | ||
*/ | ||
class AuthorizeController implements ContainerAwareInterface | ||
class AuthorizeController | ||
{ | ||
/** | ||
* @var ContainerInterface | ||
*/ | ||
protected $container; | ||
/** | ||
* @var ClientInterface | ||
*/ | ||
|
@@ -107,12 +101,11 @@ class AuthorizeController implements ContainerAwareInterface | |
|
||
/** | ||
* This controller had been made as a service due to support symfony 4 where all* services are private by default. | ||
* Thus, there is considered a bad practice to fetch services directly from container. | ||
* Thus, this is considered a bad practice to fetch services directly from container. | ||
* | ||
* @todo This controller could be refactored to do not rely on so many dependencies | ||
* @todo This controller could be refactored to not rely on so many dependencies | ||
* | ||
* @param RequestStack $requestStack | ||
* @param SessionInterface $session | ||
* @param Form $authorizeForm | ||
* @param AuthorizeFormHandler $authorizeFormHandler | ||
* @param OAuth2 $oAuth2Server | ||
|
@@ -121,11 +114,11 @@ class AuthorizeController implements ContainerAwareInterface | |
* @param UrlGeneratorInterface $router | ||
* @param ClientManagerInterface $clientManager | ||
* @param EventDispatcherInterface $eventDispatcher | ||
* @param SessionInterface $session | ||
* @param string $templateEngineType | ||
*/ | ||
public function __construct( | ||
RequestStack $requestStack, | ||
SessionInterface $session, | ||
Form $authorizeForm, | ||
AuthorizeFormHandler $authorizeFormHandler, | ||
OAuth2 $oAuth2Server, | ||
|
@@ -134,6 +127,7 @@ public function __construct( | |
UrlGeneratorInterface $router, | ||
ClientManagerInterface $clientManager, | ||
EventDispatcherInterface $eventDispatcher, | ||
SessionInterface $session = null, | ||
$templateEngineType = 'twig' | ||
) { | ||
$this->requestStack = $requestStack; | ||
|
@@ -149,16 +143,6 @@ public function __construct( | |
$this->eventDispatcher = $eventDispatcher; | ||
} | ||
|
||
/** | ||
* Sets the container. | ||
* | ||
* @param ContainerInterface|null $container A ContainerInterface instance or null | ||
*/ | ||
public function setContainer(ContainerInterface $container = null) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* Authorize. | ||
*/ | ||
|
@@ -170,7 +154,7 @@ public function authorizeAction(Request $request) | |
throw new AccessDeniedException('This user does not have access to this section.'); | ||
} | ||
|
||
if (true === $this->session->get('_fos_oauth_server.ensure_logout')) { | ||
if ($this->session && true === $this->session->get('_fos_oauth_server.ensure_logout')) { | ||
$this->session->invalidate(600); | ||
$this->session->set('_fos_oauth_server.ensure_logout', true); | ||
} | ||
|
@@ -211,7 +195,7 @@ public function authorizeAction(Request $request) | |
*/ | ||
protected function processSuccess(UserInterface $user, AuthorizeFormHandler $formHandler, Request $request) | ||
{ | ||
if (true === $this->session->get('_fos_oauth_server.ensure_logout')) { | ||
if ($this->session && true === $this->session->get('_fos_oauth_server.ensure_logout')) { | ||
$this->tokenStorage->setToken(null); | ||
$this->session->invalidate(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Custom db driver. | ||
================= | ||
|
||
The bundle provides drivers for Doctrine ORM, Doctrine MongoDB, and Propel libraries. | ||
Though sometimes you might want to use the bundle with a custom or in-house written storage. | ||
For that, the bundle has support for custom storage. | ||
Once set, setting manager options in fos_oauth_server.service section becomes mandatory. | ||
|
||
Here's an example of custom configuration: | ||
|
||
```yaml | ||
# config/packages/fos_oauth_server.yaml | ||
|
||
fos_oauth_server: | ||
db_driver: custom | ||
service: | ||
user_provider: 'user_provider_manager_service_id' | ||
client_manager: 'client_provider_manager_service_id' | ||
access_token_manager: 'access_token_manager_service_id' | ||
refresh_token_manager: 'refresh_token_manager_service_id' | ||
auth_code_manager: 'auth_code_manager_service_id' | ||
|
||
``` | ||
|
||
[Back to index](index.md) | ||
|
Oops, something went wrong.