I try to authenticate to lizmap using an external form. I have user and password. I try to use auth_login and auth_password following the issue ([Bug]: When using auth URL params (auth_login, url_password and auth_url_return) redirections not working properly. · Issue #3152 · 3liz/lizmap-web-client · GitHub) and checking also the current authentication method (3.7 version). I use a POST request https://XXXXX/lizmap/www/admin.php/auth/login/in. But I received an internal server error (500).
I see that the lizmap request has also a
JFORMS_TOKEN parameter. It is mandatory? How can I generate it?
As usual, you must check logs on the server side when there is a 500 error.
The JForms_Token is a protection about CSRF Cross-site request forgery - Wikipedia I suppose. But we don’t know your context, did you write some code ?
I try a simple html form:
<form action="../mappenew2/lizmap/www/admin.php/auth/login/in" method="post" style="display:inline-block;">
<div class="row g-3 align-items-center">
<div class="form-group">
<label for="user">Utente</label>
<input type="text" class="form-control" name="auth_login" id="auth_login" value="" maxlength="50">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" name="auth_password" id="auth_password" value="" maxlength="50"> <i class="bi bi-eye-slash"
id="togglePassword"></i>
</div>
<br>
<div class="form-group">
<input type="submit" class="btn btn-primary" >
</div>
</div>
</form>
Anyway probably this solution even if working, it is not useful for me.
My real question is: I am authenticated in a website with an user which I have replicated on my lizmap DB jlx_user table. It is possible, perhaps using a JWT token or a similar method, create a link to lizmap and be automatially logged with the user of the first website?