如何防止假註冊,因爲javascript api密鑰在客戶端源代碼中可見?我已閱讀了課程級別的權限和ACL,但對於註冊,用戶需要輸入並保存他們的用戶名和密碼才能開始。
有人可以很容易地添加假用戶/數據給某人parse.com應用程序。我知道它可能發生在其他系統上,但對於parse.com,開發人員必須警惕導致數據成本,而不是每秒處理請求。那麼如何防止呢?當然有一些機制可以阻止這種情況發生,如果它們自己的系統沒有簡單的方法來阻止它,parse.com不應該收取開發費用。parse.com JavaScript註冊安全
如果試圖從桌面在瀏覽器中運行這個網站註冊,你可以繼續添加用戶: - 編輯
<!DOCTYPE html>
<html>
<head>
<title>Reg</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.3.5.min.js"></script>
<style type="text/css">
body {
padding-top: 20px;
padding-bottom: 40px;
}
/* Custom container */
.container-narrow {
margin: 0 auto;
max-width: 700px;
}
.container-narrow > hr {
margin: 30px 0;
}
/* Main marketing message and sign up button */
.jumbotron {
margin: 60px 0;
text-align: center;
}
.jumbotron h1 {
font-size: 72px;
line-height: 1;
}
.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
}
.marketing {
margin: 60px 0;
}
.marketing p + h4 {
margin-top: 28px;
}
</style>
<script>
Parse.initialize("Your-Application-ID they got from your app/website", "Your-Javascript-Key they got from your app/website");
//#################################################################################################
$(document).ready(function() {
Parse.User.logOut();
$("#submit").click(function(){ // capture the click
//parse
var user = new Parse.User();
user.set("username", $('input[name=username]').val());
user.set("password", $('input[name=password]').val());
user.set("email", $('input[name=email]').val());
// other fields can be set just like with Parse.Object
//user.set("phone", "415-392-0202");
user.signUp(null, {
success: function(user) {
// Hooray! Let them use the app now.
var name= user.get("username");
alert(name);
},
error: function(user, error) {
// Show the error message somewhere and let the user try again.
alert("Error: " + error.code + " " + error.message);
}
});
});
});
</script>
</head>
<body>
<div class="container-narrow">
<hr>
<div id="myTabContent" class="tab-content">
<div class="tab-pane active in" id="home">
<div class="row">
<div class="span6 offset1 well">
<legend>
<h5>Sign Up</h5>
</legend>
<input type="text" id="username" class="span6" name="username" placeholder="User ID"><br><br>
<input type="text" id="email" class="span6" name="emsil" placeholder="User Email"><br><br>
<input type="password" id="password" class="span6" name="password" placeholder="Password">
<hr>
<button type="submit" id="submit" name="submit" class="btn btn-info btn-block">Sign Up</button>
</div>
</div>
</div>
<hr>
</div>
<!-- /container -->
</body>
</html>
歡迎來到SO。請訪問[幫助]查看要查詢的內容以及如何詢問 – mplungjan
是的,我的確感謝... – rkchl