<html><head></head><body bgcolor="#FFFFFF"><div>You don't need to store the password... You just need to have a session id that has a short lifetime while you browse.. &nbsp;</div><div><br></div><div><br></div><div>You can tie that session id with an ip address for additional security .</div><div><br>Francisco</div><div><br>On Feb 27, 2012, at 1:06 PM, Birger Burkhardt &lt;<a href="mailto:sysdev41@googlemail.com">sysdev41@googlemail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>Hi Francisco,<br><br>thank you for your reply. I already use sessions (FastMmap for Storage and Cookies for State). I can login to the GUI via my LDAP credentials. But the problem is: every further request has to be done with my personal credentials. Therefore the password should be stored somewhere safe. I don't want to store the userpassword in a unencrypted sessionvariable.<br>
<br>Best regards,<br>Birger<br><br><br><div class="gmail_quote">On Mon, Feb 27, 2012 at 6:52 PM, Francisco Obispo <span dir="ltr">&lt;<a href="mailto:fobispo@isc.org">fobispo@isc.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Birger,<br>
<br>
Once you've authenticated with LDAP, or with any backend, it is important that you store the session information somewhere.. Some people use a database, memcached, tmp file, or any other method.<br>
<br>
That way, when the client comes with the next request, he will offer a cookie that can be verified for authorization purposes.<br>
<br>
francisco<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Feb 27, 2012, at 2:30 AM, Birger Burkhardt wrote:<br>
<br>
&gt; Hello Peter,<br>
&gt;<br>
&gt; thank you for your reply.<br>
&gt;<br>
&gt; no, i am not storing these credentials as i thought the module would do this. I also tried to use the following package, but it doesn't work either:<br>
&gt;<br>
&gt; <a href="http://cpansearch.perl.org/src/BOBTFISH/Catalyst-Model-LDAP-FromAuthentication-0.02/README" target="_blank">http://cpansearch.perl.org/src/BOBTFISH/Catalyst-Model-LDAP-FromAuthentication-0.02/README</a><br>

&gt;<br>
&gt; According to this changelog (see entry in Version 1.007):<br>
&gt; <a href="http://cpan.uwinnipeg.ca/htdocs/Catalyst-Authentication-Store-LDAP/Changes.html" target="_blank">http://cpan.uwinnipeg.ca/htdocs/Catalyst-Authentication-Store-LDAP/Changes.html</a><br>
&gt; the user object has to be serialized and stored in the session. Do you have an idea how to do this?<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Birger<br>
&gt;<br>
&gt;<br>
&gt; On Sat, Feb 25, 2012 at 3:41 AM, Peter Karman &lt;<a href="mailto:peter@peknet.com">peter@peknet.com</a>&gt; wrote:<br>
&gt; Birger Burkhardt wrote on 2/24/12 7:22 AM:<br>
&gt;<br>
&gt; &gt; After successful authentication, all further request<br>
&gt; &gt; should be executed via the credentials of the logged in user.<br>
&gt; &gt;<br>
&gt;<br>
&gt; are you somehow storing those credentials so that they persist over the life of<br>
&gt; the session? The LDAP authn plugin does not do that for you, afaik. The<br>
&gt; credentials exist only for the life of that particular login HTTP request.<br>
&gt;<br>
&gt; or maybe I'm misunderstanding what you're trying to do?<br>
&gt;<br>
&gt; &gt; In the login controller the user is authenticated<br>
&gt; &gt; [...]<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; # Get the username and password from form<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; my $username =3D $c-&gt;request-&gt;params-&gt;{username};<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; my $password =3D $c-&gt;request-&gt;params-&gt;{password};<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; # If the username and password values were found in form<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; if ($username &amp;&amp; $password) {<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Attempt to log the user in<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($c-&gt;authenticate({ username =3D&gt; $username,<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;password =3D&gt; $password })) {<br>
&gt; &gt; [...]<br>
&gt; &gt;<br>
&gt; &gt; But when I do a new request from within another controller, i get an ldap<br>
&gt; &gt; error meaning the credentials are invalid:<br>
&gt; &gt;<br>
&gt; &gt; code in other controller:<br>
&gt; &gt; [...]<br>
&gt; &gt; &nbsp; &nbsp; my $ldapconn =3D $c-&gt;user-&gt;ldap_connection();<br>
&gt; &gt; &nbsp; &nbsp; my $mesg =3D $ldapconn-&gt;search( &nbsp; &nbsp; base =3D&gt; "ou=3Dusers,dc=3Dexample,=<br>
&gt; &gt; dc=3Dcom",<br>
&gt; &gt; filter =3D&gt; "(uid=3D*)");<br>
&gt; &gt; &nbsp; &nbsp; my @entries =3D $mesg-&gt;sorted('uid');<br>
&gt; &gt; &nbsp; &nbsp; $c-&gt;stash(users =3D&gt; \@entries,);<br>
&gt; &gt; &nbsp; &nbsp; $c-&gt;stash(template =3D&gt; 'userList.tt2');<br>
&gt; &gt; [...]<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Peter Karman &nbsp;. &nbsp;<a href="http://peknet.com/" target="_blank">http://peknet.com/</a> &nbsp;. &nbsp;<a href="mailto:peter@peknet.com">peter@peknet.com</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
&gt; Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
&gt; Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
&gt; Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
&gt; Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
&gt; Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
&gt; Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">Francisco Obispo<br>
email: <a href="mailto:fobispo@isc.org">fobispo@isc.org</a><br>
Phone: <a href="tel:%2B1%20650%20423%201374" value="+16504231374">+1 650 423 1374</a> || INOC-DBA *3557* NOC<br>
PGP KeyID = B38DB1BE<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div></div></blockquote></div><br>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a></span><br><span>Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a></span><br><span>Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a></span><br><span>Dev site: <a href="http://dev.catalyst.perl.org/">http://dev.catalyst.perl.org/</a></span><br></div></blockquote></body></html>