通过 HTTPS 使用 ESB 动态发送端口用户名密码设置客户端凭据

发布于 2024-12-17 06:21:20 字数 176 浏览 4 评论 0原文

我需要 POST 到一个hrl https://xxxxx.com,它需要用户名和密码基本身份验证

我们正在使用biztalk ESB动态发送端口

如何使用绑定配置或行为来配置它 或者我可以从 UDDI 设置它吗

I need to POST to a hrl https://xxxxx.com which expects a username and password BAsic authentication

We are using biztalk ESB dynamic send port

How do I configure this using binding configuration or behaviours
or can I set this from UDDI

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

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

发布评论

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

评论(1

妄司 2024-12-24 06:21:20

对于 WCF 适配器,您可以在 ESB 端点配置中设置任何 WCF 适配器属性
在你的情况下,它应该是这样的:

SecurityMode=TransportCredentialOnly&TransportClientCredentialType=Basic&UserName=Youruser&Password=Yourpassword

不过,以明文形式存储它们并不好。您可以改用 SSO:只需使用 UseSSO 和 AffiliateApplicationName。

您的问题也可以使用自定义端点行为来解决。您应该在 machine.config 中注册它以便从 ESB 使用。在行为上你应该有这样的东西:

        public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
    {
        ClientCredentials clientCredentials = new ClientCredentials();
        clientCredentials.UserName.UserName = "user";
        clientCredentials.UserName.Password = "password";

        bindingParameters.Add(clientCredentials);
    }

For WCF adapter you can set any WCF adapter properties in ESB Endpoint Configuration.
In your case it should be something like this:

SecurityMode=TransportCredentialOnly&TransportClientCredentialType=Basic&UserName=Youruser&Password=Yourpassword

It's not good to store them in clear text though. You can use SSO instead: just use UseSSO and AffiliateApplicationName.

Your problem can be solved using custom endpoint behavior too. You should register it in machine.config to use from ESB. In behaviour you should have something like this:

        public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
    {
        ClientCredentials clientCredentials = new ClientCredentials();
        clientCredentials.UserName.UserName = "user";
        clientCredentials.UserName.Password = "password";

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