-
Notifications
You must be signed in to change notification settings - Fork 33
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
How can I check if user is logged in at CustomCKFinderAuth.php? #8
Comments
Hi, container is already defined from extension. Here is my Authentication :
|
Hi, I tried grimmlink's Authentication, but it seems that in my case the container has no user, no token provided, although there is a logged in user in my application. Can someone give me a hint on how to get my logged user in ckfinder Authentication ? thx |
Hi @pal-ecl, Have you try injection Security service instead of authorization_checker ? |
HI @grimmlink,
But i have the same error than @envolvelabs : |
I've tired service injection
To solve problem in post above, I've added to my service.yaml
But it has no result. This way no providing auth token and method call $this->authorizationChecker->isGranted('IS_AUTHENTICATED_FULLY'); returns false. |
I've found solution that works for me.
As we can see pattern for firewall is /admin. But ckfinder's action urls start with /ckfinder. So I edited my configuration firewalls:
admin:
- pattern: /(admin)(.*)
+ pattern: /(admin|ckfinder)(.*)
context: user
form_login:
provider: fos_userbundle
login_path: /admin/login
use_forward: false
check_path: /admin/login_check
failure_path: null
logout:
path: /admin/logout
target: /admin/login
anonymous: true After that @grimmlink checking code works fine. |
You can add
|
@sigrtmax solution works for me, thanks ! |
I'm trying to implement a CustomCKFinderAuth checking if is an active user, but I'm not finding a way to use Security class inside the CustomCKFinderAuth.php.
I'm using Dependency Injection to try get the user, but I always get the error: "Too few arguments to function App\CustomCKFinderAuth\CustomCKFinderAuth::__construct(), 0 passed..."
The text was updated successfully, but these errors were encountered: