Questions tagged [angular-http-auth]

22 questions
5
votes
1 answer

angularjs basic authentication headers

I'm trying to connect to API and send authentication headers. I'm using Base64 as described here How do I get basic auth working in angularjs? function Cntrl($scope, $http, Base64) { $http.defaults.headers.common['Authorization'] = 'Basic ' +…
mrshickle
  • 73
  • 1
  • 1
  • 3
4
votes
2 answers

angular-http-auth with $http transformResponse

I'm using angular-http-auth to show a login dialog whenever a 401 "unauthorized" response is returned from the server. Since I'm cool, I also try to deserialize response objects in my services. For example, if a service requests a car and the…
Chris Clark
  • 1,439
  • 2
  • 17
  • 25
4
votes
1 answer

Angularjs - Remove last history entry after $routeChangeError

I have a route which has to resolve a server side resource. That resource asks for authentication. So i show a login form popup which is cancelable. On cancel the route/resolve gets rejected and $routeChangeError fires correctly. The issue is, that…
tagomago
  • 99
  • 2
  • 7
3
votes
0 answers

Angular 4 : " Set Cookie " flag in Http response is not setting Cookie in browser

I'm working on a Website using Angular 4. We are using Cookie authentication method. After login process API response have cookie in Set Cookie field. But its not setting value in browser. So authentication of other APIs get failed. While using…
DAN
  • 3,140
  • 5
  • 20
  • 22
3
votes
1 answer

Correct way to set and override a request header in Angular

I need to set a global http header to all my requests because of the authentication method that we are using. We have an Identity Server to authenticate the user using a SSO approach. So far so good, we were using interceptors to set headers…
2
votes
0 answers

Get httpclient request query parameters

Hi I am using an Angular 5 interceptor to check if the HttpClient request URL contains query params but it always comes back false even though in Network I see the query param being passed. import { HttpEvent, HttpInterceptor, HttpHandler,…
2
votes
1 answer

Angular 4.3 HttpClient Multiple Authorization

I have a question about HttpClientModule, how can i use it for multiple Authorization, because when use HttpInterceptor Provider, it can only use in one case for example: Api 1 has token A Api 2 has token b How can i use HttpClient for case above,…
1
vote
1 answer

Making Global Authorization Header in HttpClient Interceptor

I am making a global authorization header in my app. I've used the interceptor so i won't declare the authorization header in my get() functions. Am i correctly implementing the interceptor since when i call the get() functions, it still asking for…
1
vote
0 answers

How to make a http request with session_id from cookie

I am using angularjs2 http service to send http request. In the login API, I send a post request with user credential, the backend server generates a session_id in the response and save it on cookie. That session_id doesn't show in the http response…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
1
vote
1 answer

Angular 4 Odata (ASP.net) Windows Authentication on Chrome

I have an Angular 4 service that calls an OData API. I have my API setup to work using Windows Authentication, this works via IE (version 11) but not with Chrome, where it throws a: Failed to load resource: the server responded with a status of 401…
1
vote
1 answer

How do I apply state transition inside AngularJS $rootScope event listeners?

I am currently facing a problem in using angular-http-auth library which is handling a state transition from events of event:auth-loginRequired. I am using angular-ui-router for my routing systems. Anyway here's some pieces of code from the library…
1
vote
2 answers

add config in angular resource

I am using http-auth-interceptor for authentication. In http-auth-interceptor, I use the following way to login: var data = 'username=' + encodeURIComponent(user.userId) + '&password=' + encodeURIComponent(user.password); …
Mavlarn
  • 3,807
  • 2
  • 37
  • 57
1
vote
1 answer

AngularJS Error Code 401 handling without interceptors?

Following is the code I use, I get the Authentication Success Alert if the basic auth succeeds but the else alert "Authentication failed" is never displayed when the credentials are wrong. I do not use any routes and I don't have a need to use…
1
vote
0 answers

Restangular with angular-http-auth not working

I had been using Angular-HTTP-Auth with the basic http requests, but have since moved to Restangular and are now finding that 401's are no longer caught by HTTP-Auth. I'm assuming this is because the Angular http methods aren't used or are…
BayssMekanique
  • 894
  • 1
  • 14
  • 27
1
vote
0 answers

Protractor sendKeys fails when using angular-http-auth to display login window

I am using angular-http-auth and the example from http://witoldsz.github.io/angular-http-auth/ to display my login form. Here is the index.html page:
1
2