# |
Aug 29th 2019, 09:01 |
alexdd55976 |
https://gist.github.com/alexdd55/ecb5537a38a0871a07e19cee6a67f48e |
# |
Aug 29th 2019, 09:01 |
alexdd55976 |
@ndm i do this in application.php |
# |
Aug 29th 2019, 08:45 |
ndm |
Then the code maybe isn't actually invoked. I mean, if you were receiving that error with that code in the controller, then there had to be additional code that actually loads the identifier at middleware level. What does the stacktrace look like? |
# |
Aug 29th 2019, 08:42 |
alexdd55976 |
going from there does sadly not change anything. same error message |
# |
Aug 29th 2019, 08:40 |
ndm |
well, put it back and go from there, the controller is definitely the wrong place :slightly_smiling_face: |
# |
Aug 29th 2019, 08:40 |
alexdd55976 |
no change |
# |
Aug 29th 2019, 08:40 |
alexdd55976 |
had it there too |
# |
Aug 29th 2019, 08:39 |
ndm |
You need to configure this at middleware level, that's where the authentication happens, once you've reached the controller, the show is already over# |
# |
Aug 29th 2019, 08:38 |
alexdd55976 |
my code in appcontroller |
# |
Aug 29th 2019, 08:38 |
slackebot2 |
] ]);``` |
# |
Aug 29th 2019, 08:38 |
alexdd55976 |
``` $service->loadIdentifier('Authentication.LDAP', [ 'fields' => [ 'username' => 'username', 'password' => 'password', ], 'host' => 'ldaps://some.stuff.com', 'port' => 636, 'bindDN' => function ($username) { return 'AD\\'.$username; }, 'options' => [ 'LDAP_OPT_PROTOCOL_VERSION' => 3 |
# |
Aug 29th 2019, 08:37 |
ndm |
I'll trust the error and assume that the option isn't actually set. How do you set it? |
# |
Aug 29th 2019, 08:36 |
alexdd55976 |
of course i had to figure out the naming and stuff.. very disturbing |
# |
Aug 29th 2019, 08:36 |
alexdd55976 |
@admad the combination out of ldap + autehntication makes it hard right now... plain php was pretty straight forward |
# |
Aug 29th 2019, 08:35 |
alexdd55976 |
i would love to extend the documentation as soon as i figured out how it works |
# |
Aug 29th 2019, 08:35 |
admad |
i am happy i have never had to deal with ldap, sounds like a PITA |
# |
Aug 29th 2019, 08:34 |
alexdd55976 |
next issue is `Config `bindDN` is not set. `but i hhave it set, exactly like you said before |
# |
Aug 29th 2019, 08:33 |
alexdd55976 |
i figured that out already. thanks. |
# |
Aug 29th 2019, 08:33 |
ndm |
@alexdd55976 That means that this option only accepts a callable, which must return a "distinguished name" string, as anonymous binds (binds without a distinguished name) aren't supported. |
# |
Aug 29th 2019, 08:33 |
d.binz |
ok will do so, thought it was me :,) |
# |
Aug 29th 2019, 08:15 |
admad |
@d.binz submit an issue on GH |
# |
Aug 29th 2019, 08:15 |
alexdd55976 |
the more i read the more confused i am |
# |
Aug 29th 2019, 08:08 |
neon1024 |
Morning all :wave: |
# |
Aug 29th 2019, 07:40 |
alexdd55976 |
> bindDN: The Distinguished Name of the user to authenticate. Must be a callable. Anonymous binds are not supported. can anyone tell me what that means? |
# |
Aug 29th 2019, 07:33 |
alexdd55976 |
Auteh |
# |
Aug 29th 2019, 07:29 |
javier.villanueva |
@alexdd55976 I think that the two ways are: store the information in session (only for the user) or store the information in users database table, if is a lite information I think that is better in session for most speed access... |
# |
Aug 29th 2019, 07:26 |
d.binz |
good morning. i have a problem with authentication. i am trying beta2 at the moment with both 2.x auth plugins. i did the setup according to the book and attached both plugins to the middleware. then i created a users controller with a login method but whenever i try to login the auth check fails with a strange error "Login URL `http://localhost/users/login` did not match `/users/login`." anyone has an idea? |
# |
Aug 29th 2019, 07:25 |
alexdd55976 |
i want to do it the clean way... need the autentification later on to give users access to certain actions |
# |
Aug 29th 2019, 07:24 |
javier.villanueva |
for write to the session |
# |
Aug 29th 2019, 07:23 |
javier.villanueva |
is a lot of information for the session? |
# |
Aug 29th 2019, 07:22 |
alexdd55976 |
i was thinking saving basic authinfo from AD to Users Table and then attach more detailed work related data to the users model |
# |
Aug 29th 2019, 07:21 |
alexdd55976 |
yes. need to attach related userdata |
# |
Aug 29th 2019, 07:20 |
javier.villanueva |
do you need ad data for more than authorization? |
# |
Aug 29th 2019, 07:19 |
alexdd55976 |
Authenticate alsways wants to do stuff against users table, which... of course.. does not anything |
# |
Aug 29th 2019, 07:18 |
alexdd55976 |
i authenticate against AD, which is fine so far, but need to use authentication component to use this data |
# |
Aug 29th 2019, 07:18 |
javier.villanueva |
wich problem you have? |
# |
Aug 29th 2019, 07:14 |
alexdd55976 |
anyone can help with authentication + ldap/ad data? |
# |
Aug 29th 2019, 06:39 |
javier.villanueva |
Is it a good practice to use constants related to an entity in the global configuration file app.php? (for example entity states) |
# |
Aug 29th 2019, 06:20 |
javier.villanueva |
solved, thanks |
# |
Aug 29th 2019, 06:02 |
alexdd55976 |
Morning |
# |
Aug 29th 2019, 06:01 |
javier.villanueva |
isValidCompany or similar... |