diff --git a/composer.json b/composer.json index 2fd0b1c..b2c21b2 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ }, "require-dev": { + "phpunit/phpunit": "^5.1" }, "suggest": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bdb1848..1735b93 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,9 +1,9 @@ - + - tests/ + Tests/ diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 09c4a38..4342001 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -24,8 +24,7 @@ public function getConfigTreeBuilder() ->children() ->scalarNode('client_id')->isRequired()->cannotBeEmpty()->end() ->scalarNode('client_secret')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('domain')->defaultValue('')->end() - ->booleanNode('secret_base64_encoded')->defaultTrue()->end(); + ->scalarNode('domain')->defaultValue('')->end(); return $treeBuilder; } diff --git a/src/DependencyInjection/JWTAuthExtension.php b/src/DependencyInjection/JWTAuthExtension.php index 719b425..9507bd4 100644 --- a/src/DependencyInjection/JWTAuthExtension.php +++ b/src/DependencyInjection/JWTAuthExtension.php @@ -23,7 +23,5 @@ public function load(array $configs, ContainerBuilder $container) $container->setParameter('jwt_auth.client_id', $config['client_id']); $container->setParameter('jwt_auth.client_secret', $config['client_secret']); $container->setParameter('jwt_auth.domain', $config['domain']); - $container->setParameter('jwt_auth.secret_base64_encoded', $config['secret_base64_encoded']); } - } diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yml index 2df1cac..bcafca2 100644 --- a/src/Resources/config/services.yml +++ b/src/Resources/config/services.yml @@ -1,7 +1,7 @@ services: jwt_auth.auth0_service: class: "Auth0\\JWTAuthBundle\\Security\\Auth0Service" - arguments: [%jwt_auth.client_id%, %jwt_auth.client_secret%, %jwt_auth.domain%, %jwt_auth.secret_base64_encoded%] + arguments: [%jwt_auth.client_id%, %jwt_auth.client_secret%, %jwt_auth.domain%] jwt_auth.jwt_authenticator: class: "Auth0\\JWTAuthBundle\\Security\\JWTAuthenticator" diff --git a/src/Security/Auth0Service.php b/src/Security/Auth0Service.php index e670586..2f82fea 100644 --- a/src/Security/Auth0Service.php +++ b/src/Security/Auth0Service.php @@ -16,14 +16,17 @@ class Auth0Service { private $client_id; private $client_secret; private $domain; - private $oauth_client; - public function __construct($client_id, $client_secret, $domain, $secret_base64_encoded) + /** + * @param string $client_id + * @param string $client_secret + * @param string $domain + */ + public function __construct($client_id, $client_secret, $domain) { $this->client_id = $client_id; $this->client_secret = $client_secret; $this->domain = $domain; - $this->secret_base64_encoded = $secret_base64_encoded; } /** @@ -40,7 +43,7 @@ public function getUserProfileByA0UID($jwt, $a0UID) /** * Decodes the JWT and validate it * - * @return stdClass + * @return \stdClass */ public function decodeJWT($encToken) {