plain text
セキュリティ チームから、ログイン ページでパスワードを送信しないように求められましたが、HTTPS を使用しています。そのため、送信前にクライアント側の暗号化を行う必要があると考え、解決策を探してjCryptionを実装することにしました。
ただし、いくつかのグーグルがこれを見つけた後、そこに示されている例は PHP/pythonです。リンクで説明されていることは何でもしましたが、ユーザーがフォームで送信したフォーム データを取得する方法がわかりません。
key
ログイン ポスト バック アクションにリターンのみが表示され、LoginModel
ユーザー名、パスワードが null である必要があります。
ログイン.cshtml
@model Portal.Model.Membership.LoginModel
@using jCryption
@{
Layout = null;
jCryption.HandleRequest(Request);
}
<html>
<head>
<script src="~/Assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="~/Assets/global/plugins/jquery-migrate.min.js" type="text/javascript"></script>
@jCryption.RenderScriptFor("form", src: @Url.Content("~/Assets/admin/scripts/jquery.jcryption.3.1.0.js"))
</head>
<body>
@using (Html.BeginForm(null, null, FormMethod.Post, new { @autocomplete = "off" }))
{
<div class="form-body">
<div class="form-group">
@Html.LabelFor(x => x.Username, new { @class = "placeholder" })
@Html.TextBoxFor(x => x.Username, new { @class = "form-input", autocomplete = "off" })
<span></span>
</div>
<div class="form-group">
@Html.LabelFor(x => x.Password, new { @class = "placeholder" })
@Html.PasswordFor(x => x.Password, new { @class = "form-input", autocomplete = "off" })
<span></span>
</div>
</div>
<div class="form-group">
<button id="btnLogin">Login</button>
</div>
}
</body>
<!-- END BODY -->
</html>
更新
ログインポストアクションにブレークポイントを設定すると、次のように2回ポップアップしkey
ますjCryption
。