I\'m building an AngularJS web-app that uses a RESTful API (Jersey).
On the server side I am using a Java Application Server (in detail Glassfish 4).
My setup is
Thanks to the tip of lossleader I solved the problem. I removed the login() method, because I want the Java EE-Server to take care of authentication.
To access secured areas the AngularJS webapp has to set the HTTP-Header correctly. In my case $http.defaults.headers.common['Authorization'] = 'Basic '; where username:password has to be Base64 encoded.
After I set the headers correctly, no Password Prompt is shown and the AngularJS webapp can access the REST API.