http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&feed=atom&action=history
Custom Authenticator with FormLogin and UserInRole - Revision history
2024-03-28T10:56:10Z
Revision history for this page on the wiki
MediaWiki 1.18.0
http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&diff=4080&oldid=prev
Pcowan: Cookbook: Custom Authenticator with FormLogin and UserInRole moved to Custom Authenticator with FormLogin and UserInRole
2011-10-21T17:36:54Z
<p><a href="/index.php?title=Cookbook:_Custom_Authenticator_with_FormLogin_and_UserInRole&action=edit&redlink=1" class="new" title="Cookbook: Custom Authenticator with FormLogin and UserInRole (page does not exist)">Cookbook: Custom Authenticator with FormLogin and UserInRole</a> moved to <a href="/Custom_Authenticator_with_FormLogin_and_UserInRole" title="Custom Authenticator with FormLogin and UserInRole">Custom Authenticator with FormLogin and UserInRole</a></p>
<table class='diff diff-contentalign-left'>
<tr valign='top'>
<td colspan='1' style="background-color: white; color:black;">← Older revision</td>
<td colspan='1' style="background-color: white; color:black;">Revision as of 17:36, 21 October 2011</td>
</tr></table>
Pcowan
http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&diff=3872&oldid=prev
Ferg at 19:35, 15 November 2010
2010-11-15T19:35:02Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:35, 15 November 2010</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 46:</td>
<td colspan="2" class="diff-lineno">Line 46:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  }</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  }</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>=== login.<del class="diffchange diffchange-inline">html </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== login.<ins class="diffchange diffchange-inline">jsp </ins>===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <html></div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 56:</td>
<td colspan="2" class="diff-lineno">Line 56:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </html></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>=== error.<del class="diffchange diffchange-inline">html </del>===</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== error.<ins class="diffchange diffchange-inline">jsp </ins>===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <html></div></td></tr>
</table>
Ferg
http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&diff=3871&oldid=prev
Ferg at 19:34, 15 November 2010
2010-11-15T19:34:35Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:34, 15 November 2010</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 50:</td>
<td colspan="2" class="diff-lineno">Line 50:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <html></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <form url='j_security_check'></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <form url='j_security_check'></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  User: <input type='text' name='j_username'><del class="diffchange diffchange-inline"><</del>br></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  User: <input type='text' name='j_username'><ins class="diffchange diffchange-inline">&lt;</ins>br></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Password: <input type='password' name='j_password'><del class="diffchange diffchange-inline"><</del>br></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Password: <input type='password' name='j_password'><ins class="diffchange diffchange-inline">&lt;</ins>br></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <input type='submit'></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <input type='submit'></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </form></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </form></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </html></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>=== error.html</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>=== error.html <ins class="diffchange diffchange-inline">===</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <html></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   &lt;h1>failed login&lt;/h1></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   &lt;h1>failed login&lt;/h1></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  User: <input type='text' name='j_username'><del class="diffchange diffchange-inline"><</del>br></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  User: <input type='text' name='j_username'><ins class="diffchange diffchange-inline">&lt;</ins>br></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>  Password: <input type='password' name='j_password'><del class="diffchange diffchange-inline"><</del>br></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>  Password: <input type='password' name='j_password'><ins class="diffchange diffchange-inline">&lt;</ins>br></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <input type='submit'></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  <input type='submit'></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </form></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </form></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  </html></div></td></tr>
</table>
Ferg
http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&diff=3870&oldid=prev
Ferg at 19:34, 15 November 2010
2010-11-15T19:34:03Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:34, 15 November 2010</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 59:</td>
<td colspan="2" class="diff-lineno">Line 59:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <html></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   <html></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>   <del class="diffchange diffchange-inline"><</del>h1>failed login<del class="diffchange diffchange-inline"><</del>/h1></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>   <ins class="diffchange diffchange-inline">&lt;</ins>h1>failed login<ins class="diffchange diffchange-inline">&lt;</ins>/h1></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  User: <input type='text' name='j_username'><br></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  User: <input type='text' name='j_username'><br></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Password: <input type='password' name='j_password'><br></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  Password: <input type='password' name='j_password'><br></div></td></tr>
</table>
Ferg
http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&diff=3869&oldid=prev
Ferg at 19:33, 15 November 2010
2010-11-15T19:33:39Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:33, 15 November 2010</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 20:</td>
<td colspan="2" class="diff-lineno">Line 20:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  package qa;</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  package qa;</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  import java.security.*;</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  import java.security.*;</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  import com.caucho.security.*;</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  import com.caucho.security.*;</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"> </ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  public class TestAuthenticator extends AbstractAuthenticator {</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>  public class TestAuthenticator extends AbstractAuthenticator {</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   @Override</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>   @Override</div></td></tr>
</table>
Ferg
http://wiki3.caucho.com/index.php?title=Custom_Authenticator_with_FormLogin_and_UserInRole&diff=3868&oldid=prev
Ferg: New page: Category: Cookbook Category: Security === WEB-INF/resin-web.xml === <web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns...
2010-11-15T19:33:24Z
<p>New page: <a href="/Category:Cookbook" title="Category:Cookbook">Category: Cookbook</a> <a href="/Category:Security" title="Category:Security">Category: Security</a> === WEB-INF/resin-web.xml === <web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns...</p>
<p><b>New page</b></p><div>[[Category: Cookbook]] [[Category: Security]]<br />
<br />
=== WEB-INF/resin-web.xml ===<br />
<br />
<web-app xmlns="http://caucho.com/ns/resin"<br />
xmlns:resin="urn:java:com.caucho.resin"<br />
xmlns:qa="urn:java:qa"><br />
<br />
<qa:TestAuthenticator/><br />
<br />
<resin:FormLogin form-login-page="/login.jsp"<br />
form-error-page="/error.jsp"/><br />
<br />
<resin:Allow url-pattern="/admin/*"><br />
<resin:IfUserInRole role="admin"/><br />
</resin:Allow><br />
</web-app><br />
<br />
=== test.MyAuthenticator ===<br />
<br />
package qa;<br />
<br />
import java.security.*;<br />
<br />
import com.caucho.security.*;<br />
<br />
public class TestAuthenticator extends AbstractAuthenticator {<br />
@Override<br />
public Principal authenticate(Principal principal, char []password)<br />
{<br />
if (principal.getName().equals("harry")<br />
&& "quidditch".equals(new String(password))) {<br />
return new MyPrincipal("harry");<br />
}<br />
else {<br />
return null;<br />
}<br />
}<br />
<br />
@Override<br />
public boolean isUserInRole(Principal user, String role)<br />
{<br />
return "admin".equals(role)<br />
&& user != null && user.getName().equals("harry");<br />
}<br />
}<br />
<br />
=== login.html ===<br />
<br />
<html><br />
<form url='j_security_check'><br />
User: <input type='text' name='j_username'><br><br />
Password: <input type='password' name='j_password'><br><br />
<input type='submit'><br />
</form><br />
</html><br />
<br />
=== error.html<br />
<br />
<html><br />
<h1>failed login</h1><br />
User: <input type='text' name='j_username'><br><br />
Password: <input type='password' name='j_password'><br><br />
<input type='submit'><br />
</form><br />
</html></div>
Ferg