如何使工作流认证在Aviarc工作



我们试图将身份验证推向我的应用程序,并且对我们不起作用。

我们已经设置了当前权限和当前授权器,甚至设置了登录查询以选择" a",因此我们可以保证获得结果集。

我们已将登录工作流程复制到工作流/系统目录。

看起来甚至没有尝试运行登录查询。

start.xml 工作流:

<workflow>
    <authenticate error-screen="login-error" dataset="login">
        <show-screen name="login" />
    </authenticate>
    <call-workflow name="home"/>
</workflow>

login.xml 屏幕:

<screen xmlns:action="urn:aviarc:widget:com.aviarc.toronto.widget.core.action:1"
    xmlns:app="urn:aviarc:widget:application">
    <group-box visible="y" left="10" right="4" top="10" bottom="4" class="blue">
        <image height="80" width="245" left="10" top="5" class="mfcologo" />
        <line height="5" left="0" right="0" top="120" class="myerblue" />
        <text-static visible="y" left="74" top="151" width="80" height="20" text="User name:" />
        <text-static visible="y" left="234" top="151" width="80" height="20" text="Password:" />
        <text-edit name="username" left="74" top="182" width="100" height="20" field="login.user_name" />
        <text-edit name="password" left="234" top="182" width="100" height="20" field="login.user_password" datatype="password" />
        <button left="376" top="182" width="60" height="20" label="Login" action="Next"/>
    </group-box>
</screen>

系统/login.xml 工作流程:

<workflow xmlns:au-security="urn:aviarc:xmlcommand:au.com.aviarc.xmlcommand.security">
    <au-security:hash-text text="{$login.user_password}" result-field="login.hashed-password" />
    <dataset name="cslogin" databroker="loginqry" query="get-all">
        <param name="username" value="{$login.user_name}" />
        <param name="password" value="{$login.hashed-password}" />
    </dataset>
    <if test="dataset-empty" value1="cslogin">
        <then>
            <set-field field="login.authenticated" value="n"/>
        </then>
        <else>
            <set-field field="login.authenticated" value="y"/>
        </else>
    </if>
</workflow>

工作流身份验证需要在输入之前填充"用户名"字段,否则身份验证将立即失败,登录错误屏幕将显示。

在您的示例中,很容易修复,更改 login.xml中的行

<text-edit name="username" left="74" top="182" width="100" height="20" field="login.user_name" />

是:

<text-edit name="username" left="74" top="182" width="100" height="20" field="login.username" />

并在系统/登录 Workflow中更新引用。

最新更新