Angular 4.3 HttpClient Multiple Authorization

308 views Asked by At

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, because it only provide like this:

{ provide: HTTP_INTERCEPTORS, useClass: ApiInterceptor, multi: true }

Hope to have discussion with everyone.

1

There are 1 answers

4
Rahul Singh On

You can chain multiple interceptors and it will be called in order you specify in providers array of NgModule.