2

Is it possible to pass a user and password to basic auth in AngularJS? I am using a $http to make the request :

  var urlsave = myurl;    
  $http({method: 'GET', url: urlsave}).success(function(data) {
      console.log(data);
  })

This is the response :

Status Code:401 Unauthorized

I don't have access to the back end but there is no CORS, i just need to pass it my username and password

AT82
  • 71,416
  • 24
  • 140
  • 167
Gaz Smith
  • 1,100
  • 1
  • 16
  • 30

1 Answers1

1

Yes you can pass username and password if you know username and password.

for example : http://username:password@domain.com/api/something

Dinesh undefined
  • 5,490
  • 2
  • 19
  • 40