issue at https://doc.nette.org/en/2.4/quickstart/authentication (getting started)

8 months ago

sztanp
Member | 9
+
0
-

Hello,

I'm performing the “getting started” steps for creating a blog using Nette. It's cool !
But I'm encountering the following issue, just when I type

`
security:
users:
admin: secret # user ‘admin’, password ‘secret’
`

**I'm getting an error: **

`
Nette\DI\ServiceCreationException

Service ‘security.user’: Multiple services of type Nette\Security\IAuthenticator found: security.authenticator, 27_App_Model_UserManager. If you want to overwrite service security.authenticator, give it proper name.
`

I'm new to Nette / DI, etc, so I'm asking for a piece of explanation here plesae :-)

I'm using Nette Sandbox (cloned from github) with php 7.2 through Apache (ubuntu)

Thanx for advance for any help or suggestion :-)

8 months ago

Ondřej Kubíček
Member | 351
+
+1
-

Because Nette Sandbox uses own implementation of Nette\Security\IAuthenticator – https://github.com/…rManager.php#L13

you can have only one service

if you wanna have users in config file, it uses SimpleAuthenticator https://api.nette.org/…ticator.html, so you dont need UsersManager and have to delete from services

8 months ago

sztanp
Member | 9
+
0
-

Thanks, if I delete everything related to/using that service, it's working :-)