This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已动态机器翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
This content has been machine translated dynamically.
This content has been machine translated dynamically.
This content has been machine translated dynamically.
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.
Este artigo foi traduzido automaticamente.
这篇文章已经过机器翻译.放弃
Translation failed!
使用 nFactor 设置 cookie
您可以应用 nFactor 自定义标签并将 Cookie 设置为身份验证流程的一个因素。通过自定义标签,您可以使用 JavaScript 来操作登录架构。
要将 Cookie 设置为因素,您不需要向用户显示任何信息,这是在没有模式登录的情况下执行的。相反,您必须与用户的浏览器交互,以指示登录模式存储所需数据。加载页面时,需要登录模式才能设置 cookie。该 Cookie 使用自定义标签和 JavaScript 代码进行设置。
要实现设置 cookie 的因子,请创建一个名为 cookie.xml 的 XML 文件,以便将架构存储在 /nsconfig/loginschema/ 目录中,其内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<AuthenticateResponse xmlns="http://citrix.com/authentication/response/1">
<Status>success</Status>
<Result>more-info</Result>
<StateContext></StateContext>
<AuthenticationRequirements>
<PostBack>/nf/auth/doAuthentication.do</PostBack>
<CancelPostBack>/nf/auth/doLogoff.do</CancelPostBack>
<CancelButtonText>Cancel</CancelButtonText>
<Requirements>
<Requirement>
<Credential><ID>nsg_cookie</ID><Type>nsg_cookie</Type></Credential>
<Label><Text>Logon Type:</Text><Type>Plain</Type></Label>
</Requirement>
<Requirement>
<Credential><ID>loginBtn</ID><Type>none</Type></Credential>
<Label><Type>none</Type></Label><Input><Button>Log On</Button></Input>
</Requirement>
</Requirements>
</AuthenticationRequirements>
</AuthenticateResponse>
在此 XML 中;
- 自定义标签 nsg_cookie 用于创建 cookie 并提交表单和表单按钮。
- RfWebUI_custom 是基于 RfWebUI 主题的新门户主题。
使用 nFactor 设置 cookie 的步骤
-
根据 RfWebUI 主题创建门户主题。
add vpn portaltheme RfWebUI_custom -basetheme RfWebUI
此命令在 /var/netscaler/logon/themes/RfWebUI_custom 处为此主题创建一个文件夹
-
编辑 /var/netscaler/logon/themes/RfWebUI_custom/script.js 文件并添加以下脚本:
CTXS.ExtensionAPI.addCustomCredentialHandler({ // The name of the credential, must match the type returned by the server getCredentialTypeName: function () { return "nsg_cookie"; }, // Generate HTML for the custom credential getCredentialTypeMarkup: function (requirements) { var div = $("<div></div>"); $(document).ready(function() { //Set cookie valid for 1000 days var exdays = 1000; var d = new Date(); d.setTime(d.getTime() + (exdays\*24\*60\*60\*1000)); var expires = "expires="+ d.toUTCString(); document.cookie = "NSC_COOKIE_NAME=CookieValeu;" + expires + ";path=/"; //Submit form document.getElementById('loginBtn').click(); }); return div; } });
此代码执行以下操作:
- 等待浏览器完成页面加载
- 设置一个名为 NSC_COOKIE_NAME 的 cookie,其值为 CookieValue,有效期为 1000 天
- 自动提交表单。
创建 Cookie,用户不需要与页面交互。
-
创建一个登录模式,以绑定到表示设置 cookie 因子的策略标签。
add authentication loginSchema Cookie_LS -authenticationSchema "/nsconfig/loginschema/cookie.xml"
-
创建 NO_AUTHN 身份验证策略,以绑定到表示设置 cookie 因子的策略标签。
add authentication Policy NO_AUTHN_POL -rule TRUE -action NO_AUTHN
此策略总是评估为 true,将用户移动到下一个因子或完成身份验证流程。
-
将门户主题 RfWebUI_custom 绑定到 Citrix Gateway 虚拟服务器或 Citrix ADC AAA 虚拟服务器。
分享:
分享:
本文中包含的内容
This Preview product documentation is Citrix Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Citrix Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Citrix product purchase decisions.
If you do not agree, select Do Not Agree to exit.