There are many examples to setup an authentication provider with an login, but I can't find an example how to setup one for a package.
TYPO3 Neos v1.2.x
I have a package with an editor for the backend. The editor should communicate via controller. So far all works, but I have no access to the controller now. If I have a look at the TYPO3 Neos package Settings.yaml there is an option controllerObjectName
.
Typo3BackendProvider:
provider: 'PersistedUsernamePasswordProvider'
requestPatterns:
controllerObjectName: 'TYPO3\Neos\Controller\.*|TYPO3\Neos\Service\.*|TYPO3\Media\Controller\.*'
entryPoint: 'WebRedirect'
entryPointOptions:
routeValues:
'@package': 'TYPO3.Neos'
'@controller': 'Login'
'@action': 'index'
'@format': 'html'
If I add to this Option my controller too, then it works:
controllerObjectName: 'TYPO3\Neos\Controller\.*|TYPO3\Neos\Service\.*|TYPO3\Media\Controller\.*|Vendor\Package\Controller\Backend\.*'
But I can't imagin, that the answer is to overwrite the Neos settings.
So I tried to add an own provider with the same settings of Typo3BackendProvider
.
VendorPackageProvider:
provider: 'PersistedUsernamePasswordProvider'
requestPatterns:
controllerObjectName: 'Vendor\Package\Controller\Backend\.*'
entryPoint: 'WebRedirect'
entryPointOptions:
routeValues:
'@package': 'TYPO3.Neos'
'@controller': 'Login'
'@action': 'index'
'@format': 'html'
Cause this will not work I tried to use the tokenClass
and defined it at Typo3BackendProvider
and VendorPackageProvider
with the same name. Don't works.
The log are also not helpful:
14-12-25 17:52:25 66198 127.0.0.1 INFO Flow Session 52exQd3r1orQA35gTfjQZhhOae4x5SVh contains auth token TYPO3\Flow\Security\Authentication\Token\UsernamePassword for provider VendorPackageProvider. Status: no credentials given
14-12-25 17:52:25 66198 127.0.0.1 INFO Flow Access denied (0 denied, 0 granted, 1 abstained) to method Vendor\Package\Controller\Backend\MyController::indexAction().
14-12-25 17:52:25 66198 127.0.0.1 INFO Flow Redirecting to authentication entry point
routeValues => array (
@package => TYPO3.Neos
@controller => Login
@action => index
@format => html
)
At least my Policy.yaml:
resources:
methods:
Vendor_Package_BackendAccess: 'method(Vendor\Package\Controller\Backend\MyController->(initalize|index)Action())'
acls:
'TYPO3.Neos:Editor':
methods:
Vendor_Package_BackendAccess: GRANT