Do you mean JAAS? If you do you need to create your LoginModule as per the JAAS documentation, then define an application-policy in login-config.xml and set the login-module element to point to your LoginModule. Have a look in login-config.xml, and just copy how JBoss does it for the various outher policies it uses.
I recommend taking one of the JBoss login modules and extending it. There are some nice abstract base classes that will save you a lot of code. I had trivial example of doing this in my blog. The JBoss documentation covers this and there are other examples on the wiki.
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad: