Artifactory中与LDAP用户关联的组何时会被更新?
创始人
2024-11-11 01:00:30
0

Artifactory 中与 LDAP 用户关联的组会在用户登录时进行更新。以下是示例代码,以配置 Artifactory 与 LDAP 集成以及检查用户组是否已更新:

import org.artifactory.security.ArtifactoryAuthenticationFilter
import org.artifactory.security.ArtifactoryLdapAuthenticationProvider

// 配置 Artifactory 与 LDAP 集成
def ldapAuthProvider = ArtifactoryLdapAuthenticationProvider.create(params)

ArtifactoryAuthenticationFilter.addAuthenticationProvider(ldapAuthProvider)

// 绑定用户并检查其关联的组是否已更新
def userName = "user"
def password = "password"
def groups = []
def authentication = ldapAuthProvider.authenticate(userName, password)

if (authentication != null) {
    groups = authentication.getAuthorities().collect { it.getAuthority() }
}

println "用户 ${userName} 所在的组为: ${groups}"

相关内容

热门资讯

今日百科!微乐自建房辅助工具脚... 今日百科!微乐自建房辅助工具脚本,微乐家乡麻将自建房辅助app(开挂自建房)器1、微乐家乡麻将自建房...
程序员教你!微乐自建房辅助工具... 程序员教你!微乐自建房辅助工具脚本,微乐小程序免费黑科技(开挂自建房)方法1、微乐自建房辅助工具脚本...
技术分享!微乐自建房辅助工具脚... 技术分享!微乐自建房辅助工具脚本,微乐家乡麻将自建房辅助app(开挂自建房)器1、下载好微乐家乡麻将...
重大来袭!微乐小程序麻将自建房... 重大来袭!微乐小程序麻将自建房辅助工具插件,微乐家乡麻将自建房辅助app(开挂自建房)脚本运微乐小程...
玩家必看科普!微乐自建房辅助工... 玩家必看科普!微乐自建房辅助工具挂,微乐家乡麻将自建房辅助app(开挂自建房)技巧1)微乐家乡麻将自...
必看攻略!微乐家乡麻将自建房辅... 必看攻略!微乐家乡麻将自建房辅助app,微乐家乡麻将自建房辅助app(开挂自建房)脚本小薇(辅助器软...
科技新动态!微乐小程序麻将自建... 科技新动态!微乐小程序麻将自建房辅助工具插件,微乐自建房脚本免费入口(开挂自建房)方法1)微乐小程序...
玩家必看分享!微乐自建房辅助工... 玩家必看分享!微乐自建房辅助工具,微乐自建房脚本免费入口(开挂自建房)技巧亲,关键说明,微乐自建房辅...
重大推荐!微乐家乡麻将自建房辅... 重大推荐!微乐家乡麻将自建房辅助app,微乐小程序免费黑科技(开挂自建房)app1、点击下载安装,微...
科普攻略!微乐家乡麻将自建房辅... 科普攻略!微乐家乡麻将自建房辅助app,微乐家乡麻将自建房辅助app(开挂自建房)脚本1、不需要AI...