diff --git a/docs/_includes/navigation.html b/docs/_includes/navigation.html index 6eb08385..b2e31506 100644 --- a/docs/_includes/navigation.html +++ b/docs/_includes/navigation.html @@ -19,7 +19,6 @@
  • 社交集成
  • Google Authenticator
  • Kerberos/Spengo/AD
  • -
  • AD账号
  • LDAP
  • diff --git a/docs/authn/ldap.md b/docs/authn/ldap.md index 30404ce4..1d10d435 100644 --- a/docs/authn/ldap.md +++ b/docs/authn/ldap.md @@ -1 +1,63 @@ -TODO \ No newline at end of file +

    LDAP登录集成

    +MaxKey支持LDAP包括Active Directory。 + + +

    注释默认数据库认证

    + +打开文件maxkey/spring/maxkey-security.xml,首先注释默认数据库认证方式 + +
    
    +<!-- Default Realm-->
    +<!-- realm use jdbc -->
    +<bean id="authenticationRealm" class="org.maxkey.authn.realm.jdbc.JdbcAuthenticationRealm">
    +	<constructor-arg ref="jdbcTemplate"/>
    +</bean>
    +
    + +

    LDAP支持

    + +
    
    +<!-- LDAP Realm -->
    +<bean id="authenticationRealm" class="org.maxkey.web.authentication.realm.ldap.LdapAuthenticationRealm">
    +	<constructor-arg ref="jdbcTemplate"/>
    +	<property name="ldapServers">
    +		<list>
    +			<bean id="ldapServer1" class="org.maxkey.web.authentication.realm.ldap.LdapServer">
    +				<property name="ldapUtils">
    +					<bean id="ldapUtils" class="org.maxkey.ldap.LdapUtils">
    +						<property name="providerUrl" value="ldap://localhost:389"></property>
    +						<property name="principal" value="cn=root"></property>
    +						<property name="credentials" value="rootroot"></property>
    +						<property name="baseDN" value="dc=connsec,dc=com"></property>
    +					</bean>
    +				</property>
    +				<property name="filterAttribute" value="uid"></property>
    +			</bean>	
    +		</list>
    +	</property>
    +</bean> 
    +
    + +

    Active Directory支持

    + +
    
    +<!-- Active Directory  Realm -->
    +<bean id="authenticationRealm" class="org.maxkey.web.authentication.realm.activedirectory.ActiveDirectoryAuthenticationRealm">
    +	<constructor-arg ref="jdbcTemplate"/>
    +	<property name="activeDirectoryServers">
    +		<list>
    +			<bean id="activeDirectory1" class="org.maxkey.web.authentication.realm.activedirectory.ActiveDirectoryServer">
    +				<property name="activeDirectoryUtils">
    +					<bean id="ldapUtils" class="org.maxkey.ldap.ActiveDirectoryUtils">
    +						<property name="providerUrl" value="ldap://localhost:389"></property>
    +						<property name="principal" value="cn=root"></property>
    +						<property name="credentials" value="rootroot"></property>
    +						<property name="domain" value="connsec"></property>
    +					</bean>
    +				</property>
    +			</bean>	
    +		</list>
    +	</property>
    +</bean> 
    +
    + diff --git a/docs/authn/ldap_ad.md b/docs/authn/ldap_ad.md deleted file mode 100644 index 30404ce4..00000000 --- a/docs/authn/ldap_ad.md +++ /dev/null @@ -1 +0,0 @@ -TODO \ No newline at end of file