[英]Programmatically authenticate with Azure AD for Application Proxy
I have an on-premise hosted WCF service with REST endpoint which is configured for Anonymous authentication only in IIS. 我有一个带有REST端点的本地托管WCF服务,该端点仅在IIS中配置为进行匿名身份验证。 I installed and configured Azure App proxy connector on the server.
我在服务器上安装并配置了Azure App代理连接器。 I am able to contact the service fine with Pass-through authentication, but struggling to authenticate from a console app when Azure AD is chosen as security mechanism.
我可以通过传递身份验证很好地与服务联系,但是当选择Azure AD作为安全性机制时,很难从控制台应用程序进行身份验证。 I know I could have pass-through in Azure and turn on for example windows authentication in IIS, but this is unfortunately not an option in this case.
我知道我可以在Azure中进行传递并在IIS中打开例如Windows身份验证,但是不幸的是,在这种情况下,这不是一个选择。
Using a browser, I am able to access the application fine, don't even need to enter credentials, our on-premise AD is connected and synchronized with Azure AD. 使用浏览器,我可以很好地访问应用程序,甚至不需要输入凭据,我们的本地AD已连接并与Azure AD同步。
I followed this walk-through despite it is not regarding application proxy, and reusing parts of code I am able to get the Access Token for my application, but when I run the http request with Authorization header I don't get the result of service operation. 我跟着这个步行通过没有关于应用代理和重用的代码,我能够获得访问令牌我的应用程序部分,但是当我运行与Authorization头的HTTP请求我没有得到服务的结果,尽管它操作。
Using Fiddler I can note the following: 使用Fiddler,我可以注意以下几点:
Example I provided link for above works fine so it is clear that I am doing something wrong. 我为上述示例提供的链接示例运行正常,因此很明显我做错了。 Why is Authorization header not accepted and why am I being redirected to logon page?
为什么不接受授权标头,为什么将我重定向到登录页面?
Thanks in advance 提前致谢
This is working for another service, have no idea what was wrong with the first one, but suspecting something with DNS on local server. 这正在为另一项服务工作,不知道第一个服务出了什么问题,但怀疑本地服务器上的DNS有问题。 Won't be spending more time on this, point is that I shouldn't have experienced the redirect at all, although browser handled it and managed to get me authenticated.
不会花更多的时间在此上,这是尽管浏览器已处理重定向并设法使我通过身份验证,但我根本不应该经历重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.