Unfortunatly the EJB spec doesn't define a standard way how a login to the EJB-container is done.
The passing of principal and credential information in creation of the InitialContext is the way you login with BEA WebLogic, and is by no means standard. IIRC it's even deprecated in favor of JAAS in the latest versions of their appserver.
So stay with the JAAS login, as this is the way to do it in JBoss.
Harald is correct, passing the credentials is not standardized in the J2EE spec.
I think the way one does this in JBoss is to use org.jboss.security.jndi.LoginInitialContextFactory, and pass it a Principal and a credential in the constructor for the InitialContext.
The Weblogic InitialContext seems a little more friendly, IMHO.