这篇文章已经过机器翻译.放弃
作为 OAuth SP 的 NetScaler
身份验证、授权和审核流量管理功能支持 OAuth 身份验证,以便对托管在 Google、Facebook 和 Twitter 等应用程序上的应用程序的用户进行身份验证。
需要注意的事项
- 要使解决方案正常运行,需要 NetScaler Advanced Edition 及更高版本。
- NetScaler 上的 OAuth 适用于所有符合“OpenID connect 2.0”的 SAML IdP。
重要提示:
当内容密集型网站在会话到期时发送多个身份验证请求时,NetScaler 可能会以 CSRF 错误进行响应。作为解决方法,建议在配置 OAuth 策略时,确保为作为主要入口点的主机名和路径配置策略。
使用 GUI 配置 OAuth
-
配置 OAuth 操作和策略。
导航到安全 > AAA-应用程序流量 > 策略 > 身份验证 > 高级策略 > 策略,然后创建一个将 OAuth 作为操作类型的策略,然后将所需的 OAuth 操作与策略关联。
-
将 OAuth 策略与身份验证虚拟服务器关联。
导航到安全 > AAA-应用程序流量 > 虚拟服务器,然后将 OAuth 策略与身份验证虚拟服务器关联。
注意:
可以在 OAuth 响应中提取属性(1 到 16)。目前不评估这些属性。它们被添加以供将来参考。
使用命令行界面配置 OAuth
-
定义一个 OAuth 操作。
add authentication OAuthAction <name> [-OAuthType <OAuthType>] [-authorizationEndpoint <URL>] [-tokenEndpoint <URL>] [-idtokenDecryptEndpoint <URL>] [-clientID <string>][-clientSecret ] [-defaultAuthenticationGroup <string>] [-Attribute1 <string>] [-Attribute2 <string>] [-Attribute3 <string>] [-Attributes <string>] [-tenantID <string>] [-GraphEndpoint <string>] [-refreshInterval <positive_integer>] [-CertEndpoint <string>][-audience <string>] [-userNameField <string>] [-skewTime <mins>] [-issuer <string>] [-UserInfoURL <URL>] [-CertFilePath <string>] [-grantType ( CODE | PASSWORD )] [-authentication ( ENABLED | DISABLED )] [-introspectURL <URL>][-allowedAlgorithms <allowedAlgorithms> ...] [-PKCE ( ENABLED | DISABLED )] [-tokenEndpointAuthMethod <tokenEndpointAuthMethod>] [-metadataUrl <URL>] [-resourceUri <URL>]
-
将操作与高级身份验证策略关联。
add authentication Policy <name> -rule <expression> -action <string>
示例:
add authentication oauthAction a -authorizationEndpoint https://example.com/ -tokenEndpoint https://example.com/ -clientiD sadf -clientsecret df
有关身份验证 OAuthAction 参数的更多信息,请参阅 身份验证 oAuth
注意:
- 当指定 CertendPoint 时,NetScaler 会以配置的频率轮询该端点以了解密钥。
要将 NetScaler 配置为从该文件读取本地文件并解析密钥,引入了一个新的配置选项,如下所示:
set authentication OAuthAction <name> -CertFilePath <path to local file with jwks>
OAuth 功能现在支持来自信赖方 (RP) 端以及 NetScaler Gateway 和 NetScaler 的 IdP 端的令牌 API 中的以下功能。
-
PKCE(代码交换的证明密钥)支持
-
支持 client_assertion
对 OAuth 身份验证的名称-值属性支持
现在,您可以使用唯一的名称和值来配置 OAuth 身份验证属性。这些名称在 OAuth 操作参数中配置为“属性”,而值则通过查询名称获得。提取的属性存储在身份验证、授权和审核会话中。管理员可以根据指定属性名称的选定方法,使用 http.req.user.attribute("attribute name")
或 http.req.user.attribute(1)
查询这些属性。
通过指定属性的名称,管理员可以轻松搜索与该属性名称关联的属性值。此外,管理员不再需要仅凭编号记住“attribute1 to attribute16”。
重要
在 OAuth 命令中,您最多可以配置 64 个以逗号分隔的属性,总大小小于 1024 字节。
注意
如果“属性 1 到属性 16”的总值大小和“属性”中指定的属性值不超过 10 KB,则可以避免会话失败。
使用 CLI 配置名称/值属性
在命令提示符下,键入:
add authentication OAuthAction <name> [-Attributes <string>]
set authentication OAuthAction <name> [-Attributes <string>]
示例:
add authentication OAuthAction a1 –attributes "email,company" –attribute1 email
set authentication OAuthAction oAuthAct1 -attributes "mail,sn,userprincipalName"