PSI 身份验证仅返回 401

发布于 2024-12-11 22:39:38 字数 594 浏览 0 评论 0原文

我正在开发一个网络服务,它将成为许多应用程序和 PSI 之间的“看门人”。问题是“许多应用程序”将提供登录名/密码,并且 Web 服务必须根据 PSI 对它们进行身份验证。但无论我做什么,当我调用“PSIFormsLogin.Login(user,password)”方法时,我总是收到 401 Unauthorized 错误...我什至使用了运行农场的用户...

我也已经遵循了以下 MS 教程: http://msdn.microsoft.com/en-us/library/ff181538.aspx

最后我想做的就是验证使用 PSI Web 服务提供的帐户/密码,谁能告诉我我做错了什么???

PS:不是 WCF

新信息:发生了一些有趣的事情。我故意将 URL 切换为不存在的: http://myserver/pwa/_vti_bin/psi /bla.asmx 但我仍然得到 401...

I'm developing a web-service that is going to be a "gatekeeper" between many apps and the PSI. the thing is that the "many apps" will supply a login/password and the web-service must authenticate them against the PSI. But whatever i do i always get a 401 Unauthorized error when i call the "PSIFormsLogin.Login(user,password)" method... ive used even the user that runs the farm...

ive also already followed the following MS tutorial: http://msdn.microsoft.com/en-us/library/ff181538.aspx

in the end all i wanna do is validate the account/password supplyed using the PSI web-Services, can anyone pls tell me what am i doing wrong???

PS: not the WCF

New Info: something funny happened. I intentionally switched the URL to a non-existent on: http://myserver/pwa/_vti_bin/psi/bla.asmx but i still got a 401...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

靑春怀旧 2024-12-18 22:39:38

确保您已像这样修改了应用程序的 web.config。只需覆盖绑定节点中的安全节点即可:

<binding name="WssInteropSoap">
  <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm"
        realm="" />
    <message clientCredentialType="UserName" algorithmSuite="Default" />
  </security>
</binding>

现在您可以在没有特殊帐户(来自 Windows 的通道)的情况下进行身份验证,或者使用此代码,您可以指定一个帐户:

//credential impersonation (just if you changed your binding settings)
projectSvc.ClientCredentials.Windows.ClientCredential = new NetworkCredential("username", "password", "domain");
projectSvc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

我希望它会有所帮助:)

但是,我从未听说过一个名为“PSIFormsLogin.Login”的函数,

也许我的关于使用 C# 建立与 PSI 的连接的博客文章对您来说很有趣:通过 PSI 读取 Project Server 2010 CustomFields

Make sure you have modified the web.config of your application like this. Just overwrite the security node in the binding node:

<binding name="WssInteropSoap">
  <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm"
        realm="" />
    <message clientCredentialType="UserName" algorithmSuite="Default" />
  </security>
</binding>

Now you can authenticate without a special account (passtrough from windows) or with this code, you can specify an account:

//credential impersonation (just if you changed your binding settings)
projectSvc.ClientCredentials.Windows.ClientCredential = new NetworkCredential("username", "password", "domain");
projectSvc.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

I hope it will help :)

But, I've never heard of a function which is called: "PSIFormsLogin.Login"

Maybe my blog entry for setting up a connection to the PSI with C# is interesting for you: Read Project Server 2010 CustomFields over PSI

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文