0

アプリに認証を導入しようとしていますが、うまくいきません。

Current Authority と Current Authorizer を設定し、ログイン クエリを「a」を選択するだけに設定したので、結果セットを確実に取得できます。

Login ワークフローを workflows/system ディレクトリにコピーしました。

ログインクエリを実行しようとしているようにも見えません。

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>

system/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>
4

1 に答える 1

0

ワークフロー認証では、入力する前に「ユーザー名」フィールドに入力する必要があります。そうしないと、認証がすぐに失敗し、ログイン エラー画面が表示されます。

あなたの例では、 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" />

システム/ログインワークフローでそれへの参照を更新します。

于 2012-10-28T23:27:47.370 に答える