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}"

相关内容

热门资讯

曝光透视!wepokerplu... 曝光透视!wepokerplus透视脚本免费,微乐小程序游戏破解器,模板教程(有挂攻略)-哔哩哔哩1...
必备透视!wepoker私人局... 必备透视!wepoker私人局怎么玩,微乐麻将脚本掌上程序,模块教程(竟然有挂)-哔哩哔哩一、wep...
总结透视!德扑圈透视挂,微乐自... 总结透视!德扑圈透视挂,微乐自建房脚本使用安全吗,窍要教程(有挂实锤)-哔哩哔哩1、游戏颠覆性的策略...
辅助透视!We poker辅助... 辅助透视!We poker辅助器下载,微乐钻石兑换码,策略教程(发现有挂)-哔哩哔哩1、进入到We ...
解谜透视!sohoo开挂辅助,... 解谜透视!sohoo开挂辅助,万能透视辅助器免费版,要领教程(有挂神器)-哔哩哔哩1)sohoo开挂...
有挂透视!wepoker辅助是... 有挂透视!wepoker辅助是真的假的,微信小程序游戏破解器,模板教程(确实有挂)-哔哩哔哩1、让任...
辅助透视!pokemmo手机脚... 辅助透视!pokemmo手机脚本辅助器,微乐自建房脚本使用安全吗,讲义教程(有挂教程)-哔哩哔哩在进...
专业透视!wepoker可以透... 专业透视!wepoker可以透视码,微乐小程序授权,方针教程(有挂详细)-哔哩哔哩1、游戏颠覆性的策...
必备透视!wepoker私人局... 必备透视!wepoker私人局外卦,微乐脚本,阶段教程(存在有挂)-哔哩哔哩1、游戏颠覆性的策略玩法...
开挂透视!wepoker免费透... 开挂透视!wepoker免费透视脚本,微信小程序微乐辅助器教程图片,教材教程(讲解有挂)-哔哩哔哩运...