无身份验证的来宾访问固定门户

无身份验证的来宾访问固定门户

42159
Created On 09/25/18 17:39 PM - Last Modified 06/14/23 07:16 AM


Resolution


附加到此帖子的是一个固定门户舒适页的示例, 该页面已修改为在 "来宾访问" 环境中使用。 这里的目的是强迫用户点击一个按钮, 确认他们承认使用条款, 然后才允许访问网络/互联网。 您需要创建一个 "来宾" 用户 (本文中不包括), 以便在该门户中使用。

 

附加页面与 "内置" 固定门户舒适页面相同。 我刚刚添加了必要的 javascript, 使被捕获的门户工作没有用户的身份验证。 您只需将希望显示的 HTML/文本添加到 "来宾" 用户。

 

要使用新的 "固定门户舒适" 页, 请执行以下操作:

1.) 转到 "设备" 选项卡, 然后单击左侧的 "响应页"。
2.) 点击 "固定门户舒适页"。
3.) 单击 "导入" 按钮, 选择刚刚编辑的文件, 选择位置 (共享或 VSYS), 然后单击 "确定"。
4.) 提交配置.

 

 

附加文件的内容:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><META http-equiv="PRAGMA" content="NO-CACHE"><meta name="viewport" content="initial-scale=1.0"><title>用户标识门户</title><style> html, body{ height: 99%; } body { color: #111; font-family: Verdana,Arial,Helvetica,sans-serif; background-color:#d2d6dA; vertical-align: middle; } #activearea { border-width: 2px; border-color: #c2c6cA; border-style: solid; border-radius: 15px; background-color: #ffffff; padding: 20px; max-width: 400px; margin-left: auto; margin-right: auto; } #heading { font-size: 1.1em; font-weight: bold; max-width: 400px; margin-left: auto; margin-right: auto; text-align: center; } #desc { font-size: 1em; margin: 15px; max-width: 400px; text-align: left; margin-left: auto; margin-right: auto; } form td span { font-size: 1em; font-weight: bold; } #formtable { height: 100%; width: 100%; } #taLogin { width: 250px; margin-left: auto; margin-right: auto; } .buttonFixed { font-size: 1em; } .msg { background-color: #ffff99; border-width: 2px; border-color: #ff0000; border-style: solid; border-radius: 5px; margin-top: 0.5em; padding: 0.5em; max-height: 150px; height: expression( this.scrollHeight > 150 ? "150px" : "auto" ); /* sets max-height for IE */ overflow: auto; font-size: 1em; }</style></head><!-- Changed LoadPage function to myLoadPage function for onload --><body onload="myLoadPage();"><table id="formtable"><tr><td>用户标识门户<x 81=""><div id="desc">您试图访问的资源在访问之前需要正确的用户标识。</div></td></tr></table></body></html> 请输入您的凭据。

<!-- This function hides the "pan_form", provides a new submit button and populates the username, password, escapeUser, and submit values used by the backend to process the form -->
<script>
function myLoadPage() {
//get the login form object
var my_form = document.getElementById("login_form");

//get the username form object
var my_user = document.getElementsByName("user")[0];
//populate the username form object with the configured "guest" user
my_user.setAttribute("value", "guestuser");

//get the password form object
var my_pass = document.getElementsByName("passwd")[0];
//populate the password object with the configured "guest" password
my_pass.setAttribute("value", "guestpass");

//get the escapeUser form object
var escape_user = document.getElementsByName("escapeUser")[0];
//populate the escapeUser object with the configured "guest" user
escape_user.setAttribute("value", "guestuser");

//remove the existing submit button from the DOM
document.getElementById("submit").remove();

//add a new custom button to the DOM with our own text on it
my_form.insertAdjacentHTML('beforeend', '<button class="buttonFixed" type="submit" id="submit" name="ok" onclick="submitClicked()" value="Login">Accept and Continue</button>');

//get the entire "original" login form object
var hide_form = document.getElementById("taLogin");

//hide the "original" login form object
//we need it to POST but not be visible
hide_form.style.visibility = "hidden";
hide_form.style.position = "absolute";
}
</script>
<pan_form>
</pan_form>




 



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClH9CAK&lang=zh_CN&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language