Skip to content
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

Problems with Testuser #73

Open
ghellstern opened this issue Jun 23, 2024 · 11 comments
Open

Problems with Testuser #73

ghellstern opened this issue Jun 23, 2024 · 11 comments

Comments

@ghellstern
Copy link

I wanted to to try HAWKI in a simple local setup with a testuser.

In .env I therefore specified:

Authentication="LDAP"
# LDAP config
#LDAP_HOST="ldaps://..."
#LDAP_BASE_DN="cn=...,ou=...,dc=..."
#LDAP_BIND_PW="..."
#LDAP_SEARCH_DN="ou=...,dc=..."
#LDAP_PORT=""
#; Choose the filter based on your LDAP configuration. the value "username" is used as a placeholder and will be replaced with the actual #username in authentication function.
#; EXAMPLES:
#; (|(sAMAccountName=username)(mail=username))
#; (|(uid=username)(mail=username))
#LDAP_FILTER="(|(sAMAccountName=username)(mail=username))"

# Testuser accout
TESTUSER="test"
TESTPASSWORD="test"


When submitting the login and the password the following error appears on the web-server:

[::1]:58325 [500]: POST /login - Uncaught Error: Call to undefined function ldap_escape() in C:....\HAWKI\private\app\php\auth.php:138
Stack trace:
#0 C:...\HAWKI\private\pages\login.php(17): require_once()
#1 C:....\HAWKI\index.php(18): include_once('...')
#2 {main}
thrown in C:...\HAWKI\private\app\php\auth.php on line 138

Any idea whats going wrong??

Thanks a lot for a hint!!

@ItsNotYou
Copy link
Contributor

Did you install the dependencies via composer? See https://getcomposer.org/doc/01-basic-usage.md and https://github.com/HAWK-Digital-Environments/HAWKI/blob/main/composer_install.sh for details.

php composer.phar update

@Ariansdf
Copy link
Collaborator

Hey @ghellstern,
did you try @ItsNotYou's suggestion?
I've never had this issue myself. Ldap escape is already in php 8. you can check here for more info.
but the code itself is meant to prevent code injection. I think if you comment out the line, you can still test the rest of the project.

@ghellstern
Copy link
Author

Hi @Adriansdf!
The hint by @ItsNotYou unfortunately did't help - but commenting out the line with Ldap escape did :-) Since I want to test only locally, it will not harm...
Thanks a lot for your support !

@ShUl0w
Copy link
Contributor

ShUl0w commented Aug 8, 2024

Hi @ghellstern,

I ran into the same issue when dockerizing HAWKI for local development. In my case, my PHP-image (8-bullseye) was missing libldap2-dev and the LDAP extension. Depending on your setup, you might want to try and install those to fix the issue.

@DanielBarie
Copy link

@ShUl0w: Would you mind sharing your Docker instructions?

@ShUl0w
Copy link
Contributor

ShUl0w commented Aug 15, 2024

Hi @DanielBarie,

sure, I set up a basic repository with a working php-apache based Dockerfile for HAWKI. Please note that this is not equivalent to what I'm using for local development, which is a bit more involved.

@Ariansdf I don't know if its any help for the project, but maybe it would be a good idea to provide a docker image / documentation for trying HAWKI locally for the less tech-savy?

@DanielBarie
Copy link

@ShUl0w: Appreciate! Makes life a little bit easier.

@Ariansdf: Would you mind extending the readme for more detailed setup instructions? Or maybe have a Wiki?

@Ariansdf
Copy link
Collaborator

@ShUl0w
I'm sure Docker will facilitate the deployment process and we will definitely include it in our next main release.
Unfortunately at the moment I don't have the capacity but our colleagues at Hochschule Munich and Cologne University are working on it.

@Ariansdf
Copy link
Collaborator

@ShUl0w: Appreciate! Makes life a little bit easier.

@Ariansdf: Would you mind extending the readme for more detailed setup instructions? Or maybe have a Wiki?

I'm working on a detailed documentation for the next main release.

@ShUl0w
Copy link
Contributor

ShUl0w commented Aug 15, 2024

@Ariansdf Awesome; in case I can be of help, feel free to reach out. I will keep my repo up until there's an official image / documentation, and dispose of it once those are implemented.

@Ariansdf
Copy link
Collaborator

@Ariansdf Awesome; in case I can be of help, feel free to reach out. I will keep my repo up until there's an official image / documentation, and dispose of it once those are implemented.

That sounds fantastic!
We are in the process of starting collaborations with some colleagues, and we would love for you to join our weekly meetings. If you're interested, please email me ( [email protected] ), and I'll be happy to send you an invitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants