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安卓版破... 近年来!德普之星app安卓版破解版(透视)都是是真的辅助插件(有挂教学)-哔哩哔哩1、德普之星app...
近日!aapoker怎么拿好牌... 近日!aapoker怎么拿好牌(透视)果然是真的辅助软件(有挂方法)-哔哩哔哩1.aapoker怎么...
透视计算!pokemmo脚本辅... 透视计算!pokemmo脚本辅助器下载(透视)果然存在有辅助神器(确实有挂)-哔哩哔哩1、很好的工具...
据监测!德州局脚本(透视)竟然... 据监测!德州局脚本(透视)竟然真的有辅助工具(新版有挂)-哔哩哔哩1、任何德州局脚本透视是真的假的的...
最终!wepoker怎么破解游... 最终!wepoker怎么破解游戏(透视)确实真的有辅助平台(有挂技术)-哔哩哔哩wepoker怎么破...
透视规律!pokemmo手机版... 透视规律!pokemmo手机版透视脚本(透视)都是是真的辅助神器(的确有挂)-哔哩哔哩1.pokem...
据文件显示!wepoker模拟... 据文件显示!wepoker模拟器哪个好用(透视)原来是真的辅助工具(有挂教学)-哔哩哔哩1、实时we...
透视ai代打!pokeplus... 透视ai代打!pokeplus脚本(透视)本来真的有辅助平台(有挂教学)-哔哩哔哩1、pokeplu...
受玩家影响!竞技联盟辅助(透视... 受玩家影响!竞技联盟辅助(透视)原来是真的辅助插件(有挂方式)-哔哩哔哩亲,关键说明,竞技联盟辅助透...
透视新版!德州局怎么透视(透视... 透视新版!德州局怎么透视(透视)本来真的是有辅助app(揭秘有挂)-哔哩哔哩;1、该软件可以轻松地帮...