Tag: alfresco

如何在没有用户密码的情况下获取Alfresco登录票证,但使用用户主体名称(UPN)模拟用户

我正在编写一个DLL,它具有在不使用用户密码的情况下获取Alfresco登录票证的function,仅使用用户主体名称(UPN)。 我正在调用alfresco REST API服务/ wcservice 。 我在Alfresco使用NTLM。 我正在冒充使用WindowsIdentity构造函数的用户,如http://msdn.microsoft.com/en-us/library/ms998351.aspx#paght000023_impersonatingbyusingwindowsidentity所述 。 我检查并且用户被正确模拟(我检查了WindowsIdentity.GetCurrent().Name属性)。 在模仿用户之后,我尝试使用CredentialsCache.DefaultNetworkCredentials制作HttpWebRequest并设置其凭据。 我收到错误: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() 当我使用new NetworkCredential(“username”, “P@ssw0rd”)来设置请求凭据时,我获得了Alfresco登录票证( HttpStatusCode.OK ,200)。 有没有办法可以在没有用户密码的情况下获得Alfresco登录票? 这是我正在使用的代码: private string GetTicket(string UPN) { WindowsIdentity identity = new WindowsIdentity(UPN); WindowsImpersonationContext context = null; try { context = identity.Impersonate(); MakeWebRequest(); } catch (Exception e) { return […]