Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

HTTP Basic Authentication Fails on IOS

$
0
0

@lugomulish wrote:

Hi guys.

I have trouble making GET requests with basic autentication header ..

This is my code .

$ Http.defaults.headers.common [ ' authorization '] = ' Basic ' + base64.encode ( user.username + ' : ' + user.password ) ;
$http.get(ENV.apiEndpoint + 'api/token/' + uuid)
.success(function (data, status) {
alert("success");
if (data.token) {
$rootScope.token = data.token;
}
deferred.resolve(data);
})
.error(function (response) {
alert("failed");
deferred.resolve(response);
});

This code works fine on Android, but iOS does not return any result ... (the alerts don't show never) .

Any suggestions ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>