We're currently struggling with an issue in our azure environment. In our current setup we have an application gateway connecting to 2 application services.
- 1 app service is using basic auth. Nothing is wrong here and it works as expected.
- The second app service is using OAUTH with an external Identity server. When connecting this app service through the gateway all calls result in a 401 Unauthorized error.
Quick sketch of our environment:
We've investigated the calls to the service in azure and saw the following: First a redirect to the gateway with a Good token: Secondly the call that results in a 401 error. As you can see this call has no token anymore:
If we don't go through the gateway we are able to connect to the service with the same token. When we go through the gateway we get the Unauthorized error.
The application gateway is set as following: A listener and 2 backend pools with a path rule. All calls with /service1/* will go to the first app service, while calls with /service2/* will go to the second.
Does anybody know why authentication fails and how to resolve this? If any more info is required, just ask me Thanks in advance.