[Flow] Policy.yaml - Could not authenticate any token

Stefan Bruggmann mail at newgen.ch
Mon Jun 1 14:11:30 CEST 2015


Hi All

I wanted to implement some async notification functions, but gets errors if I'm trying to restrict these notifications to Neos User.. ;)
The source: https://github.com/sbruggmann/WebExcess.Notifications/tree/develop

What it should do:
A JS-Interval requests the defined Route and executes the returned JS-Code.
And that only for loggedin Neos User


Policy.yaml
---
privilegeTargets:
  'TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilege':
    'WebExcess.Notifications:Controller':
      matcher: 'method(WebExcess\Notifications\Controller\NotificationController->(get|add)Action())'
roles:
  'TYPO3.Neos:Administrator':
    privileges:
      -
        privilegeTarget: 'WebExcess.Notifications:Controller'
        permission: GRANT
---

Ends in the error:

Might be missing or wrong credentials or no authentication provider matched.
Evaluated following 2 privilege target(s):
"WebExcess.Notifications:Controller": ABSTAIN
"TYPO3.Neos:AllControllerActions": ABSTAIN
(0 granted, 0 denied, 2 abstained)


Policy.yaml
---
privilegeTargets:
  'TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilege':
    'WebExcess.Notifications:Controller':
      matcher: 'method(WebExcess\Notifications\Controller\NotificationController->(get|add)Action())'
roles:
  'TYPO3.Flow:Everybody':
    privileges:
      -
        privilegeTarget: 'WebExcess.Notifications:Controller'
        permission: GRANT
---

Result:
Works fine


Any idea whats wrong in my source?

Regards,
Stefan


More information about the Flow mailing list