Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #32 from cultuurnet/feature/III-3198
Browse files Browse the repository at this point in the history
Feature: III-3198
  • Loading branch information
Bert Ramakers committed Jan 17, 2020
2 parents e365072 + 39265e0 commit e608660
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/log
/config.yml
/.idea
public.pem
*.pem
external_id_mapping_place.yml
external_id_mapping_organizer.yml
14 changes: 7 additions & 7 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

use CultuurNet\SymfonySecurityJwt\Authentication\JwtUserToken;
use CultuurNet\UDB3\Jwt\Symfony\Authentication\JwtUserToken;

use CultuurNet\UDB3\Jwt\Udb3Token;
use CultuurNet\UDB3\UiTPASService\CultureFeedServiceProvider;
use DerAlex\Silex\YamlConfigServiceProvider;
use JDesrosiers\Silex\Provider\CorsServiceProvider;
use Lcobucci\JWT\Token as Jwt;
use Silex\Application;
use Silex\Provider\UrlGeneratorServiceProvider;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
Expand Down Expand Up @@ -50,15 +51,14 @@ function(Application $app) {

$app['current_user'] = $app::share(
function (Application $app) {
/* @var Jwt|null $jwt */
$jwt = $app['jwt'];

if ($jwt instanceof Jwt) {
if ($jwt instanceof Udb3Token) {
$cfUser = new CultureFeed_User();

$cfUser->id = $jwt->getClaim('uid');
$cfUser->nick = $jwt->getClaim('nick');
$cfUser->mbox = $jwt->getClaim('email');
$cfUser->id = $jwt->id();
$cfUser->nick = $jwt->userName();
$cfUser->mbox = $jwt->email();

return $cfUser;
}
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"cultuurnet/culturefeed-php": "~1.10",
"cultuurnet/deserializer": "~0.1",
"cultuurnet/silex-amqp": "~0.1",
"cultuurnet/silex-service-provider-jwt": "~0.1",
"cultuurnet/symfony-security-jwt": "~0.1",
"cultuurnet/udb3-api-guard": "~0.1",
"cultuurnet/udb3-http-foundation": "~0.1",
"cultuurnet/udb3-jwt": "~0.1",
"cultuurnet/valueobjects": "~3.0",
"deralex/yaml-config-service-provider": "~1.0",
"jdesrosiers/silex-cors-provider": "~0.1.4",
"knplabs/console-service-provider": "~1.0",
"monolog/monolog": "~1.11",
"silex/silex": "~1.3",
"cultuurnet/udb3-api-guard": "~0.1"
"symfony/security": "~2.7.3"
},
"require-dev": {
"phpunit/phpunit": "~5.7",
Expand Down
Loading

0 comments on commit e608660

Please sign in to comment.