I am currently using Jhipster to create the following components:
- UAA - Auth Server
- API Gateway
- Microservice - Product1
- Discovery Service - Consul
Other components:
- Custom Frontend (Angular 4) - in a separate project
It is also important to note that the user interface uses Jhipster angular 4 code, which can be found in the vanilla Jipster Api Gateway. This includes the custom HTTPProvider.
The included classes can be seen in the image below: 
At the moment, I can successfully log in with this setting and call the API in UAA, however, when I try to call any of the APIS on the Product, I get 401 Unauthorized , for example Publish to Product1 / api / zcd .
The Consul has all visible and green services, and Gateway also has UAA and Product1 as registered and accessible routes.

So far, I have found that it does not appear that the AuthInterceptor is called when I make an api call for Product. I tried to manually add the jwt token to the methods, and this fixes the problem, but I cannot understand why customHttpProvider is not used to intercept the request and add the token.
My ProductService below works when I insert a token manually, as shown, but this is obviously not the most correct way to do this.
@Injectable() export class ProductService { private options = new Headers(); constructor(private http: Http) { this.options.append('Authorization', 'Bearer ' + 'token is inserted here'); } priceProduct(productPriceRequest: productPriceRequest): Observable<IdResponse> { return this.http.post('Product1/api/zcd', productPriceRequest, { headers: this.options }) .map(response => response.json()); } }
source share