第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

spring LDAP模板認(rèn)證

spring LDAP模板認(rèn)證

大話西游666 2021-09-03 15:41:23
我正在嘗試通過 spring ldap 對(duì)用戶進(jìn)行身份驗(yàn)證。以下是初始化 ldap 模板的代碼。contextSource = new LdapContextSource();contextSource.setUrl("ldaps://ldap.example.com");contextSource.setBase("DC=example,DC=com");contextSource.setUserDn("backend-app");contextSource.setPassword("password");contextSource.afterPropertiesSet();PoolingContextSource pooledContextSource = new PoolingContextSource(); pooledContextSource.setDirContextValidator(new DefaultDirContextValidator());pooledContextSource.setContextSource(contextSource);ldapTemplate =  new LdapTemplate(pooledContextSource); ldapTemplate.afterPropertiesSet();當(dāng)我嘗試使用 ldapTemplate 身份驗(yàn)證方法時(shí),它返回 false。// below line failsldapTemplate.authenticate("OU=Service Accounts,OU=Pseudo-Users", "frontend-web", "password");但是當(dāng)我使用目錄上下文時(shí)它可以工作DirContext ctx = null;try {  ctx = contextSource.getContext("frontend-web", "password");  return true;} catch (Exception e) {  logger.error("Login failed", e);  return false;} finally {  LdapUtils.closeContext(ctx);  }問題 1:無(wú)論如何要使 ldaptemplate 身份驗(yàn)證方法起作用嗎?問題二:直接使用DirectoryContext時(shí)為什么不用提供baseDn。ldap 如何知道在哪里可以找到用戶“frontend-web”。它是否在整個(gè)目錄中搜索用戶“frontend-web”任何人都可以幫忙。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 577 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)