我生命中stackoverflow中的第一个问题!
我来自嵌入式程序设计领域,并且对Web安全性有非常肤浅的了解。我已经使用Google Apps脚本构建了平台。所有数据均存储在数据表中。一切正常。我很快想到了这种身份验证方案,说实话,我确定它一定是不安全的!绝对,我想念一些东西!这是我的过程:
这是服务电话:
var addedContent = '<script>var session={sessionId="UUID"}</script>';
return HtmlService.createTemplateFromFile... ...addedContent(addedContent);
Run Code Online (Sandbox Code Playgroud)
我使用.addedContent()调用将UUID字符串附加为javascript变量,该变量是在成功登录后使用Utilities.getUuid()生成的。
会调用google.script.run async的函数示例:
function get_user(username){
...
var session = {username: username, sessionId: lastUUID};
// don't confuse the two username properties.
// the username for the authentication is inside the session object.
// the property 'username' of the data object is for the getUser function
// …Run Code Online (Sandbox Code Playgroud) javascript security authentication web-applications google-apps-script