wip4
This commit is contained in:
parent
53a1a3fad1
commit
19dd4ba368
@ -21,24 +21,8 @@ security:
|
|||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||||
security: false
|
security: false
|
||||||
oauth_token:
|
oauth_token:
|
||||||
pattern: ^/oauth/token$
|
pattern: ^/oauth/(token|authorize)$
|
||||||
security: false
|
security: false
|
||||||
oauth_authorize:
|
|
||||||
pattern: ^/oauth/authorize$
|
|
||||||
security: true
|
|
||||||
entry_point: App\Security\Authenticator
|
|
||||||
guard:
|
|
||||||
authenticators:
|
|
||||||
- App\Security\Authenticator
|
|
||||||
provider: local_user
|
|
||||||
oauth:
|
|
||||||
guard:
|
|
||||||
authenticators:
|
|
||||||
- Trikoder\Bundle\OAuth2Bundle\Security\Guard\Authenticator\OAuth2Authenticator
|
|
||||||
provider: local_user
|
|
||||||
pattern: ^/oauth/
|
|
||||||
security: true
|
|
||||||
stateless: true
|
|
||||||
api_apps:
|
api_apps:
|
||||||
pattern: ^/api/v1/apps$
|
pattern: ^/api/v1/apps$
|
||||||
security: false
|
security: false
|
||||||
|
@ -80,6 +80,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
|
|||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use SymfonyCasts\Bundle\ResetPassword\ResetPasswordHelperInterface;
|
use SymfonyCasts\Bundle\ResetPassword\ResetPasswordHelperInterface;
|
||||||
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
|
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
|
||||||
|
use Trikoder\Bundle\OAuth2Bundle\Event\AuthorizationRequestResolveEvent;
|
||||||
use Trikoder\Bundle\OAuth2Bundle\Event\UserResolveEvent;
|
use Trikoder\Bundle\OAuth2Bundle\Event\UserResolveEvent;
|
||||||
use Trikoder\Bundle\OAuth2Bundle\OAuth2Events;
|
use Trikoder\Bundle\OAuth2Bundle\OAuth2Events;
|
||||||
use Twig\Environment;
|
use Twig\Environment;
|
||||||
@ -286,6 +287,12 @@ class GNUsocial implements EventSubscriberInterface
|
|||||||
$event->setUser($user);
|
$event->setUser($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function authRequestResolve(AuthorizationRequestResolveEvent $event): void
|
||||||
|
{
|
||||||
|
// TODO: if using 3rd party clients, make sure the user approves access
|
||||||
|
$event->resolveAuthorization(true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell Symfony which events we want to listen to, which Symfony detects and auto-wires
|
* Tell Symfony which events we want to listen to, which Symfony detects and auto-wires
|
||||||
* due to this implementing the `EventSubscriberInterface`
|
* due to this implementing the `EventSubscriberInterface`
|
||||||
@ -293,9 +300,10 @@ class GNUsocial implements EventSubscriberInterface
|
|||||||
public static function getSubscribedEvents(): array
|
public static function getSubscribedEvents(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
KernelEvents::REQUEST => 'onKernelRequest',
|
KernelEvents::REQUEST => 'onKernelRequest',
|
||||||
'console.command' => 'onCommand',
|
'console.command' => 'onCommand',
|
||||||
OAuth2Events::USER_RESOLVE => 'userResolve',
|
OAuth2Events::USER_RESOLVE => 'userResolve',
|
||||||
|
OAuth2Events::AUTHORIZATION_REQUEST_RESOLVE => 'authRequestResolve',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user