How do I authenticate a user? Is it application server specific just like the RDBMS realm in Weblogic? Is it possible to programatically assign a role to a specific user?

Thanks in advanced...
Jerson