I forgot to mention:
6) I registered my Realm using the Glassfish GUI so it's in domain.xml
7) I dumped my Realm/LoginModule JAR file into <glassfish>/lib (not into domains/domain1/lib as recommended by others because this yielded ClassNotFoundError).
8) web.xml contains:
<security-constraint>
<display-name>Playlistlog</display-name>
<web-resource-collection>
<web-resource-name>PlaylistLog</web-resource-name>
<description/>
<url-pattern>/playlists/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>HEAD</http-method>
<http-method>PUT</http-method>
<http-method>OPTIONS</http-method>
<http-method>TRACE</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>myRole</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>somePackage.myRealm</realm-name>
</login-config>
<security-role>
<description/>
<role-name>myRole</role-name>
</security-role>
9) sun-web.xml contains:
<security-role-mapping>
<role-name>myRole</role-name>
<principal-name>myRole</principal-name>
</security-role-mapping>
10) ... I didn't edit any other files. So if you see any steps missing please point it out :)
Thanks,
Gili
[Message sent by forum member 'cowwoc' (cowwoc)]
http://forums.java.net/jive/thread.jspa?messageID=321141