VBA Kerberos身份验证 [英] VBA Kerberos Authentication

查看:829
本文介绍了VBA Kerberos身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想发送POST请求到一个Java servlet使用VBA Kerberos票据从Windows登录进行身份验证,然后检索从servlet的JSON响应。我能做到这一点,而无需使用InternetExplorer对象,例如使用WinHtt prequest?

I want to send a POST request to a Java servlet with VBA using the Kerberos ticket from the Windows Log In for authentication and then retrieve a JSON response from the servlet. Can I achieve this without using an InternetExplorer object, e.g. using WinHttpRequest?

推荐答案

WinHtt prequest 不是IE对象。上述用例只要完美的设置了放松的安全权限的工作。我已经实现了概念证​​明去年:Excel中,VBA,REST,Tomcat的,SPNEGO认证

WinHttpRequest is not an IE object. The above described usecase works perfectly as long as you set up to relax the security permissions. I have implemented a proof of concept last year: Excel, VBA, REST, Tomcat, SPNEGO authentication.

存根code:

Dim winHttp As Object
Set winHttp = CreateObject("WinHttp.WinHttpRequest.5.1")

winHttp.SetAutoLogonPolicy (0)
winHttp.Open "GET", "http://..."
winHttp.send

Dim success As Boolean
success = winHttp.waitForResponse(5)
If Not success Then
    Debug.Print "DOWNLOAD FAILED!"
    Exit Sub
End If

Dim responseText As String
responseText = winHttp.responseText

这篇关于VBA Kerberos身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆