Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to specify keycloak version #382

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,8 @@ knpu_oauth2_client:
# encryption_key_path: null
# Optional: Encryption key, i.e. contents of key or certificate
# encryption_key: null
# Optional: The keycloak version to run against
# version: '20.0.1'
# whether to check OAuth2 "state": defaults to true
# use_state: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function buildConfiguration(NodeBuilder $node)
->defaultNull()
->info('Optional: Encryption key, i.e. contents of key or certificate')
->end()
->scalarNode('version')
->example("version: '20.0.1'")
->info('Optional: The keycloak version to run against')
->end()
;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Security/Exception/FinishRegistrationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class FinishRegistrationException extends AuthenticationException
* @param int $code
* @param \Exception $previous
*/
public function __construct($userInfo, $message = '', $code = 0, Exception $previous = null)
public function __construct($userInfo, $message = '', $code = 0, \Exception $previous = null)
{
$this->userInformation = $userInfo;

Expand Down
9 changes: 4 additions & 5 deletions src/Security/Helper/FinishRegistrationBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace KnpU\OAuth2ClientBundle\Security\Helper;

use KnpU\OAuth2ClientBundle\Security\Exception\FinishRegistrationException;
use LogicException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface;

Expand All @@ -24,13 +23,13 @@ trait FinishRegistrationBehavior
/**
* Call this from within your onAuthenticationFailure() method.
*
* @throws LogicException
* @throws \LogicException
*/
protected function saveUserInfoToSession(Request $request, FinishRegistrationException $e)
{
// save the user information!
if (!$request->hasSession() || !$request->getSession() instanceof SessionInterface) {
throw new LogicException('In order to save user info, you must have a session available.');
throw new \LogicException('In order to save user info, you must have a session available.');
}
$session = $request->getSession();

Expand All @@ -45,12 +44,12 @@ protected function saveUserInfoToSession(Request $request, FinishRegistrationExc
*
* @return mixed
*
* @throws LogicException
* @throws \LogicException
*/
public function getUserInfoFromSession(Request $request)
{
if (!$request->hasSession() || !$request->getSession() instanceof SessionInterface) {
throw new LogicException('In order to have saved user info, you must have a session available.');
throw new \LogicException('In order to have saved user info, you must have a session available.');
}
$session = $request->getSession();

Expand Down