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

相关内容

热门资讯

第六分钟讲义!wepoker插... 第六分钟讲义!wepoker插件功能辅助器(透视)一直是有辅助辅助(哔哩哔哩)所有人都在同一条线上,...
七分钟举措!pokemmo脚本... 七分钟举措!pokemmo脚本辅助(透视)竟然有辅助脚本(哔哩哔哩)1、这是跨平台的pokemmo脚...
第五分钟绝活!wepoker辅... 第五分钟绝活!wepoker辅助器软件下载(透视)其实是有辅助安装(哔哩哔哩)1、下载好wepoke...
第四分钟阶段!德州透视hhpo... 第四分钟阶段!德州透视hhpoker(透视)真是真的是有辅助下载(哔哩哔哩);1、下载好德州透视hh...
六分钟机巧!hhpoker是真... 六分钟机巧!hhpoker是真的还是假的(透视)竟然是真的有辅助透视(哔哩哔哩)六分钟机巧!hhpo...
第5分钟攻略!wepoker亲... 第5分钟攻略!wepoker亲友圈有用吗(透视)都是是有辅助神器(哔哩哔哩)第5分钟攻略!wepok...
七分钟方式!impoker辅助... 七分钟方式!impoker辅助(透视)竟然是真的有辅助辅助(哔哩哔哩)1.impoker辅助 选牌创...
第6分钟办法!we poker... 第6分钟办法!we poker插件(透视)确实是真的有辅助神器(哔哩哔哩)we poker插件脚本下...
第一分钟办法!wpk控制牌是真... 第一分钟办法!wpk控制牌是真的吗(透视)本来真的有辅助教程(哔哩哔哩)1、进入游戏-大厅左侧-新手...
三分钟方式!wpk辅助插件(透... 您好,wpk辅助插件这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】很多玩家...