配置 NetScaler Gateway 虚拟服务器以进行 MSAL 令牌身份验证

Last published : Oct 14, 2026
要配置 NetScaler Gateway 虚拟服务器以监控 MSAL 令牌身份验证,您需要以下信息:
  • authorizationEndpoint:未经验证的用户必须重定向到的端点 URL。NetScaler Gateway 通过添加查询参数(包括客户端 ID)将用户重定向到此 URL。如果未指定此参数,则默认情况下用户将重定向到在 tokenEndpoint 中配置的 URL。
  • tokenEndpoint:NetScaler Gateway 发布 OAuth 令牌以验证其真实性的端点 URL。用户在成功身份验证后可以从授权服务器获取 OAuth 令牌。
  • GraphEndpoint:Graph API 服务的 URL,用于了解企业移动服务 (EMS) 端点。
  • certEndpoint:包含用于 MSAL 令牌验证的 JSON Web Key (JWK) 的端点 URL。
  • Audience:应用程序向其发送 MSAL 令牌的 NetScaler 虚拟服务器的 FQDN。
  • Issuer:Microsoft Entra ID 颁发者的名称。默认情况下会自动填充。
  • TenantID:用于 MSAL 注册的租户 ID。
  • ClientID:作为 MSAL 注册的一部分授予 Gateway 应用程序的唯一 ID。
  • ClientSecret:作为 MSAL 注册的一部分授予 Gateway 应用程序的密钥。
  • ResourceURI:一个可选参数,用于捕获资源 URI。如果未配置,NetScaler 将使用 Azure 商业资源 URI。
使用 CLI 执行以下步骤:
  1. 创建 OAuth 操作。
    add authentication OAuthAction <oauth_action_name> -OAuthType <INTUNE> -authorizationEndpoint <authorization_endpoint_fqdn> -tokenEndpoint <token_endpoint_fqdn> -clientID <client_id_val> -clientSecret <client_secret_val> -tenantID <tenant_id_value> -GraphEndpoint <graph_endpoint_fqdn> -CertEndpoint <cert_endpoint_fqdn>
  2. 将身份验证策略标签添加到 OAuth 操作。
    add authentication policylabel <policy_label_name>
  3. 创建一个身份验证策略,并将其与新创建的 OAuth 操作关联。
    add authentication Policy <policy_name> -rule <true> -action <oauth_intune_action>
  4. 将身份验证策略绑定到策略标签。
    bind authentication policylabel <policy_label_name> -policyName <policy_name> -priority 100
  5. 配置身份验证虚拟服务器。
    add authentication vserver <authvserver> SSL <0.0.0.0>
    bind ssl vserver <authvserver> -certkeyName <cert_key_file_name>
    bind authentication vserver <authvserver> -policy <ldap_policy_name> -priority 100 -nextFactor <policy_label_name>
  6. 配置 VPN 虚拟服务器。
    add authentication authnProfile <vpn_profile_name> -authnVsName <authvserver>
    add vpn vserver <vserver_name> SSL <vpn_ip_address> -authnProfile <vpn_profile_name>
示例配置:
add authentication OAuthAction oauth_action_for_NAC -OAuthType INTUNE -authorizationEndpoint "https://login.microsoftonline.com/ed10c531-5d7b-4a5c-bb29-564c20480754/oauth2/v2.0/authorize" -tokenEndpoint "https://login.microsoftonline.com/ed10c531-5d7b-4a5c-bb29-564c20480754/oauth2/v2.0/token" -clientID 1dc2adc3-0298-4ff5-9bf5-b98852ff58ba -clientSecret 6zM8Q~b4Hr9wwHEGFla.VDsiMWjvG~PS6PKv7c2m -tenantID ed10c531-5d7b-4a5c-bb29-564c20480754

add authentication policylabel intune_oauth_pol_label

add authentication Policy oauth_intune_pol -rule true -action oauth_action_for_NAC

bind authentication policylabel intune_oauth_pol_label -policyName oauth_intune_pol -priority 100

add authentication vserver av_vs SSL 0.0.0.0
bind ssl vserver av_vs -certkeyName crt_key_file_name
bind authentication vserver av_vs -policy ldap_policy_name -priority 100 -nextFactor intune_oauth_pol_label

add authentication authnProfile vpn_authnprofile -authnVsName av_vs
add vpn vserver vpn_sp SSL VPN_IP_Address 443 -authnProfile vpn_authnprofile
注意:
示例配置中的参数必须根据要求进行修改。在示例配置中:
  • OAuthType、clientID、clientSecret 和 tenantID 是强制参数。
  • 如果用户在创建 OAuth 操作时未配置以下参数,则这些参数将填充默认值:
    • GraphEndpoint:<https://graph.microsoft.com/>
    • AllowedTokenAlgorithms:HS256、RS256、RS512
    • TokenEndpointAuthMethod:client_secret_post
    • GrantType:代码
  • 在 authorizationEndpoint 和 tokenEndpoint 中使用的 tenantID 是 ed10c531-5d7b-4a5c-bb29-564c20480754。
  • 所使用的 loginSchema 是默认方案。根据用例,必须选择适当的登录方案。
  • LDAP 被选为第一个身份验证因素,OAuth 被选为下一个因素,并绑定到身份验证虚拟服务器。这可以根据使用情况进行修改。