<div dir="ltr">hi,<div><br></div><div>I'm running MapServer 8 under Debian 12/Apache 2.4 and PostgreSQL 17.5/PostGIS 3.5</div><div>and W*S already authenticated using auth/dbd under Apache/SSL, which works fine with:</div><div><br></div><div>Alias /my_wms_link /path/to/mapserv.fcgi<br><Location /my_wms_link><br>   SetHandler cgi-script<br>   AddHandler fcgid-script .fcgi<br>   Options ExecCGI Indexes FollowSymLinks<br>   SetEnv MAPSERVER_CONFIG_FILE /etc/mapserver8.conf<br>   SetEnv MS_MAPFILE /var/mapserver/etc/my_mapfile.map<br>   Require all denied   <br>   AuthBasicProvider dbd<br>   AuthName "Login needed!"<br>   AuthType Basic<br>   Require valid-user<br>   AuthDBDUserPWQuery "SELECT u.passwd, u.login_name FROM table_users u WHERE u.login = %s"<br></Location></div><div><br></div><div>But, I'm wondering if it is possible to define an apache variable here, in .conf apache, and then to read/access this variable at layer level in MapFile. eg.: to pass the userLoginName for Layer->Processing(NATIVE_FILTER) and then load only specific set of data for the given user.</div><div>I tried  " SetEnv ms_user %{AUTH_USER}  " or %{AUTH_USER};</div><div><br></div><div>By now, the only way I got it was using alternative 2 CGI script from <a href="https://mapserver.org/cgi/wrapper.html">https://mapserver.org/cgi/wrapper.html</a> with</div><div>. . .</div><div>QUERY_STRING="ms_user=${REMOTE_USER}&${QUERY_STRING}"</div><div>exec ${MAPSERV}</div><div><br></div><div>Or Apache mod_rewrite would be better in this case?</div><div><br></div><div><br>Eduardo Kanegae<br><a href="https://180hs.com.br/en">https://180hs.com.br/en</a><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div></div></div></div></div></div></div>