为OpenID Connect用户分配更有可读性的用户名。

开始之前,请按照查看OpenID Connect用户声明中的步骤获取用户声明。
SystemLink使用OpenID Connect声明为每个用户创建一个唯一的用户名。SystemLink默认使用sub和iss声明,以确保值在所有提供程序中都是唯一的。但是,这些声明通常包含来自提供程序的内部ID或URL。
为避免创建重复用户和丢失每个用户的设置,请在用户开始使用服务器之前配置用户名。
  1. 登录运行SystemLink的服务器,找到 C:\Program Files\National Instruments\Shared\Web Server\conf\defines.d\目录,在文本编辑器中打开50_mod_auth_openidc-defines.conf
  2. 将配置UnDefine AUTH_OIDC_USER_CLAIM更改为Define AUTH_OIDC_USER_CLAIM ,并附加您希望SystemLink用作用户名claim名称。文件应该与下列范例类似。
    备注 用户名在所有已启用的提供程序(包括OpenID Connect、LDAP、Windows和Web Server)中必须是唯一的。
    #
    # Defined OpenID-Connect configuration for the Windows Apache installation.
    #
    
    # The name of the JSON map containing metadata about each identity provider.
    Define AUTH_OIDC_ATTRIBUTES_KEY ni-attributes
    
    # CA bundle to use when making requests to an identity provider.
    Define AUTH_OIDC_BUNDLE ../nicurl/ca-bundle.crt
    
    # Override the OIDCCacheShmEntrySizeMax to mitigate claim size issues
    Define AUTH_OIDC_CACHE_ENTRY_SIZE 66065
    
    # Path to OIDC provider configuration.
    Define AUTH_OIDC_PROVIDER_DIR ${HTCONF_PATH}/openidc
    
    # The location to redirect when performing an OpenID-Connect login.
    Define AUTH_OIDC_REDIRECT_URI /login/openidc-redirect
    
    #
    # User-editable variables.
    #
    
    # Whether OIDC is enabled.
    Define AUTH_OIDC_ENABLED
    
    # The claim that will be used as the SystemLink user name.
    # If not defined, a combination of the sub and iss claims will be used.
    Define AUTH_OIDC_USER_CLAIM email
    
    # When enabled, /login/openidc-redirect?info=json and
    # /login/openidc-redirect?info=html will return the claims for the currently
    # logged in user.
    UnDefine AUTH_OIDC_ENABLE_CLAIM_INFO
  3. 保存文件并重启NI Web服务器。