I've got a JAX-RS API (running on a Wildfly 8 server) that's used by a Javascript-based web application. We're learning as we're going along, so apologies for anything that might be stupid about this implementation.
We've got Basic Authentication with PBKDF2-based password storage up and running, but for obvious reasons we do not want the user to have to authenticate each time they click a new navigation item in the web application.
What we're currently doing while in development is to take the credentials the first time they're entered and store them in a BASE64-encoded local variable that's used in all subsequent requests (everything goes over HTTPS).
The question is, for production, is this an acceptable way of handling user credentials, or is it a big no-no?
And if it's a no-no, how should you do it instead? After all, using sessions sort of goes against the idea of RESTful web services to begin with, and stateful Java Session Beans don't seem to work too well with JAX-RS (based on what I've been able to read).