I am using a basic authentication in my ionic app. I am using $http.jsonp & $http.post in my services, my jsonp services are fetching data if I am attaching username and password with the url like - http://usernameString:PasswordString@localhost:3000
BUT, $http.post service is throwing the following error -
Error: Access to restricted URI denied
Though its working in Chrome but not in firefox(following error is in Firefox Version 33).
your headers are incorrect because they are not base64 encoded… take a look at the code snippet i provided again… it works in postman because it will encode the credentials for you
I used the header you specified, in postman and in web browser, it works. But on android, it shows up the standard http basic auth dialog, “authentication required” with username and password fields…no matter what is entered, it keeps prompting the dialog. And on iOS, nothing shows up and it doesnt work.