【问题标题】:Connecting to a K2 server without manually specifying username/password无需手动指定用户名/密码即可连接到 K2 服务器
【发布时间】:2014-11-27 16:43:10
【问题描述】:

K2 开发者参考中的连接到 K2 服务器的示例如 herehere 都涉及在连接参数中设置用户名和密码。使用这种方法意味着我需要以明文或最多使用双向加密存储密码,这显然不是一个好习惯。

是否有另一种方法(可能使用令牌)来建立这些连接?很难相信每个使用此功能的应用都只是在某个地方存储了一个密码,这会带来明显的安全隐患。

【问题讨论】:

    标签: k2


    【解决方案1】:

    注意 - 我不是 K2 API 专家,但我将它作为一种产品遇到过,并且确实知道它本身就支持 Windows 身份验证。您为其提供链接的同一页面指出以下内容 -

    connectionSetup.ConnectionParameters["Authenticate"] = "true";
    connectionSetup.ConnectionParameters["Host"] = "LOCALHOST";
    connectionSetup.ConnectionParameters["Integrated"] = "true";
    connectionSetup.ConnectionParameters["IsPrimaryLogin"] = "true";
    //connectionSetup.ConnectionParameters["Originator"] = "false";
    connectionSetup.ConnectionParameters["Password"] = "{YourPassword}";
    connectionSetup.ConnectionParameters["Port"] = "5252";
    connectionSetup.ConnectionParameters["SecurityLabelName"] = "K2";
    //connectionSetup.ConnectionParameters["SecurityPackage"] = "Kerberos,NTLM";
    connectionSetup.ConnectionParameters["UserID"] = "{YourUserName}";
    connectionSetup.ConnectionParameters["WindowsDomain"] = "{YourDomain}";
    

    这里的第三个参数是Integrated=true,虽然文档没有明确说明,但我建议使用此参数,并尝试连接同时忽略user idpassword假设 K2 配置为Windows Authentication,它应该可以工作而无需提供明确的用户名或密码..当然也不需要自己将它们存储为 K2 的客户端。

    【讨论】:

      【解决方案2】:

      您可以使用集成安全性。然后,K2 将使用与当前登录用户相同的用户,并且您不需要需要传递任何凭据。

      【讨论】:

        猜你喜欢
        • 2010-09-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-09-28
        • 2021-12-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多