问题概述
当我们在jhipster uaa中进行ldap集成时,GET / api / account返回500错误,用户出现在ldap目录而不是uaa DB中,因此它返回500错误,没有找到用户
动机或用例
这是一个疑问,所以我的问题是我们应该在成功通过Ldap认证后在DB中添加用户,还是需要根据我的要求更新API,这将是解决方案。
重现错误
在uaa中添加嵌入式ldap配置:
@override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
if (enabled.equalsIgnoreCase("true")) {
ContextSourceBuilder csb = auth.ldapAuthentication().userSearchBase(userSearchBase).userSearchFilter(userSearchFilter).groupSearchBase(groupSearchBase).groupSearchFilter(groupSearchFilter).contextSource();
if (StringUtils.isNotEmpty(root)) {
csb.root(root);
}
if (StringUtils.isNotEmpty(ldapUrl)) {
csb.url(ldapUrl);
}
if (StringUtils.isNotEmpty(ldifFilePath)) {
csb.ldif(ldifFilePath);
}
if (StringUtils.isNotEmpty(manager)) {
csb.managerDn(manager);
}
if (StringUtils.isNotEmpty(managerPassword)) {
csb.managerPassword(managerPassword);
}
} else {
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}
}
当用户登录时,将从ldap目录验证用户,并在登录后获取GET / api / account以获取某些信息。用户不在uaa app DB中,因此它返回错误。
相关问题
建议修复
JHipster Version(s)
4.3.0
JHipster配置
欢迎使用JHipster信息子发生器
JHipster Version(s)
/家庭/ varunn / GIT中/ etuaa ` - generator-jhipster@4.3.0
JHipster配置,在根文件夹
中生成的.yo-rc.json文件{
"generator-jhipster": {
"promptValues": {
"packageName": "com.abc.uaa",
"nativeLanguage": "en"
},
"jhipsterVersion": "4.3.0",
"baseName": "uaa",
"packageName": "com.abc.uaa",
"packageFolder": "com/abc/uaa",
"serverPort": "9999",
"authenticationType": "uaa",
"hibernateCache": "hazelcast",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Disk",
"prodDatabaseType": "mysql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": "eureka",
"buildTool": "maven",
"enableSocialSignIn": false,
"enableTranslation": true,
"applicationType": "uaa",
"testFrameworks": [
"gatling",
"cucumber"
],
"jhiPrefix": "jhi",
"skipClient": true,
"nativeLanguage": "en",
"languages": [
"en",
"fr",
"es"
],
"clientPackageManager": "yarn"
}
}
.jhipster目录中生成的实体配置entityName.json文件
ls:没有这样的文件或目录:.jhipster / * .json
浏览器和操作系统
java version" 1.8.0_131" Java(TM)SE运行时环境(版本1.8.0_131-b11) Java HotSpot(TM)64位服务器VM(内置25.131-b11,混合模式)
git version 2.7.4
node:v8.4.0
npm:5.3.0
yeoman:1.8.5
纱线:0.24.6Docker版本17.03.1-ce,构建c6d412e
docker-compose版本1.14.0,构建c7bdf9e
.jhipster目录中生成的实体配置entityName.json文件
浏览器和操作系统
Chrome和
Ubuntu 16.04