Wiki source code of org.clazzes.login.ldap
Version 6.1 by christoph_lechleitner@iteg_at on 2014-01-03 04.05:26
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | = {{id name="org.clazzes.login.ldap-Functionality"/}}Functionality = | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | The LDAP login service authenticates against users in an ADS domain or against users in an LDAP server configured for an individual domain. | ||
| 6 | |||
| 7 | The function {{code language="none"}}tryLogin(){{/code}} needs credentials if run against a legacy LDAP Server. | ||
| 8 | |||
| 9 | For AD DS servers, an additional non-search authentication method {{code language="none"}}bindAds{{/code}} is implemented for {{code language="none"}}tryLogin(){{/code}}, which tries to bind using a principal in the form {{code language="none"}}user@domain{{/code}}. | ||
| 10 | |||
| 11 | The functions {{code language="none"}}searchUser(){{/code}}, {{code language="none"}}getGroups(){{/code}}, {{code language="none"}}getGroupMembers(){{/code}} need bind credentials and will only work in AD DS environments. | ||
| 12 | |||
| 13 | = {{id name="org.clazzes.login.ldap-SampleConfigurationforauthenticationagainstanADS-Domain"/}}Sample Configuration for authentication against an ADS-Domain{{id name="org.clazzes.login.ldap-sampleAdsConfig"/}} = | ||
| 14 | |||
| 15 | The following sample configuration is the most common configuration OSGi configuration in PID {{code language="none"}}org.clazzes.login.ldap{{/code}}, which allows you to authenticate users against an Active Directory Domain. | ||
| 16 | |||
| 17 | All you need to know is the Windows/NetBIOS Name of your domain and the corresponding DNS name used to physically locate the Active Directory server. | ||
| 18 | |||
| 19 | In our example we use {{code language="none"}}EXAMPLE{{/code}} as the Windows/NetBIOS domain name with its DNS counterpart {{code language="none"}}example.com{{/code}}. | ||
| 20 | |||
| 21 | |=((( | ||
| 22 | (% class="tablesorter-header-inner" %) | ||
| 23 | ((( | ||
| 24 | Key | ||
| 25 | ))) | ||
| 26 | )))|=((( | ||
| 27 | (% class="tablesorter-header-inner" %) | ||
| 28 | ((( | ||
| 29 | Value | ||
| 30 | ))) | ||
| 31 | ))) | ||
| 32 | |((( | ||
| 33 | {{code language="none"}} | ||
| 34 | defaultDomain | ||
| 35 | {{/code}} | ||
| 36 | )))|((( | ||
| 37 | {{code language="none"}} | ||
| 38 | EXAMPLE | ||
| 39 | {{/code}} | ||
| 40 | ))) | ||
| 41 | |((( | ||
| 42 | {{code language="none"}} | ||
| 43 | domain.EXAMPLE.controllerUri | ||
| 44 | {{/code}} | ||
| 45 | )))|((( | ||
| 46 | {{code language="none"}} | ||
| 47 | ads://example.com | ||
| 48 | {{/code}} | ||
| 49 | ))) | ||
| 50 | |((( | ||
| 51 | {{code language="none"}} | ||
| 52 | domain.EXAMPLE.authMethod | ||
| 53 | {{/code}} | ||
| 54 | )))|((( | ||
| 55 | {{code language="none"}} | ||
| 56 | bindAds | ||
| 57 | {{/code}} | ||
| 58 | ))) | ||
| 59 | |||
| 60 | = {{id name="org.clazzes.login.ldap-DetailedConfiguration"/}}Detailed Configuration = | ||
| 61 | |||
| 62 | The LDAP login service may be configured using the OSGi configuration PID {{code language="none"}}org.clazzes.login.ldap{{/code}} using these configuration values: | ||
| 63 | |||
| 64 | |=((( | ||
| 65 | (% class="tablesorter-header-inner" %) | ||
| 66 | ((( | ||
| 67 | Key | ||
| 68 | ))) | ||
| 69 | )))|=((( | ||
| 70 | (% class="tablesorter-header-inner" %) | ||
| 71 | ((( | ||
| 72 | Default Value | ||
| 73 | ))) | ||
| 74 | )))|=((( | ||
| 75 | (% class="tablesorter-header-inner" %) | ||
| 76 | ((( | ||
| 77 | Description | ||
| 78 | ))) | ||
| 79 | ))) | ||
| 80 | |((( | ||
| 81 | {{code language="none"}} | ||
| 82 | defaultDomain | ||
| 83 | {{/code}} | ||
| 84 | )))|((( | ||
| 85 | |||
| 86 | )))|((( | ||
| 87 | The domain to use for principals, which do not contain a domain. | ||
| 88 | ))) | ||
| 89 | |((( | ||
| 90 | {{code language="none"}} | ||
| 91 | domain.<domain>.controllerUri | ||
| 92 | {{/code}} | ||
| 93 | )))|((( | ||
| 94 | |||
| 95 | )))|((( | ||
| 96 | The server to contact. Supported URL schemes: {{code language="none"}}ldap{{/code}}, {{code language="none"}}ldaps{{/code}}, {{code language="none"}}ads{{/code}}. See below | ||
| 97 | ))) | ||
| 98 | |((( | ||
| 99 | {{code language="none"}} | ||
| 100 | domain.<domain>.authMethod | ||
| 101 | {{/code}} | ||
| 102 | )))|((( | ||
| 103 | {{code language="none"}} | ||
| 104 | searchAndBind | ||
| 105 | {{/code}} | ||
| 106 | )))|((( | ||
| 107 | The method for authenticating a user. Supported methods: {{code language="none"}}searchAndBind{{/code}}, {{code language="none"}}bindAds{{/code}}. | ||
| 108 | ))) | ||
| 109 | |((( | ||
| 110 | {{code language="none"}} | ||
| 111 | domain.<domain>.bindUser | ||
| 112 | {{/code}} | ||
| 113 | )))|((( | ||
| 114 | |||
| 115 | )))|((( | ||
| 116 | The DN used for binding before searching something in the domain <domain>. For {{code language="none"}}tryLogin(){{/code}} this applies only to the authMethod {{code language="none"}}searchAndBind{{/code}}. | ||
| 117 | ))) | ||
| 118 | |((( | ||
| 119 | {{code language="none"}} | ||
| 120 | domain.<domain>.bindPassword | ||
| 121 | {{/code}} | ||
| 122 | )))|((( | ||
| 123 | |||
| 124 | )))|((( | ||
| 125 | The password used for binding searching something in the domain <domain>. For {{code language="none"}}tryLogin(){{/code}} this applies only to the authMethod {{code language="none"}}searchAndBind{{/code}}. | ||
| 126 | ))) | ||
| 127 | |((( | ||
| 128 | {{code language="none"}} | ||
| 129 | domain.<domain>.userAttribute | ||
| 130 | {{/code}} | ||
| 131 | )))|((( | ||
| 132 | {{code language="none"}} | ||
| 133 | samAccountName | ||
| 134 | {{/code}} | ||
| 135 | )))|((( | ||
| 136 | The LDAP attribute to use for finding a given user name. | ||
| 137 | ))) | ||
| 138 | |((( | ||
| 139 | {{code language="none"}} | ||
| 140 | domain.<domain>.prettyNameAttribute | ||
| 141 | {{/code}} | ||
| 142 | )))|((( | ||
| 143 | {{code language="none"}} | ||
| 144 | cn | ||
| 145 | {{/code}} | ||
| 146 | )))|((( | ||
| 147 | The LDAP attribute to try to use as pretty name for users and groups. | ||
| 148 | ))) | ||
| 149 | |((( | ||
| 150 | {{code language="none"}} | ||
| 151 | domain.<domain>.eMailAddressAttribute | ||
| 152 | {{/code}} | ||
| 153 | )))|((( | ||
| 154 | {{code language="none"}} | ||
| 155 | |||
| 156 | {{/code}} | ||
| 157 | )))|((( | ||
| 158 | The LDAP attribute to try to use as primary e-mail address for users. | ||
| 159 | ))) | ||
| 160 | |||
| 161 | There may be multiple domains in a configuration. | ||
| 162 | |||
| 163 | === {{id name="org.clazzes.login.ldap-ControllerSchemes"/}}Controller Schemes === | ||
| 164 | |||
| 165 | The URL schemes for a domain controller are ldap, ldaps and ads. | ||
| 166 | |||
| 167 | The {{code language="none"}}ads{{/code}} URL scheme for the URL {{code language="none"}}ads://mydomain.com{{/code}} undertakes a lookup for the DNS records | ||
| 168 | |||
| 169 | (% class="code" %) | ||
| 170 | ((( | ||
| 171 | SRV _ldap._tcp.mydomain.com | ||
| 172 | TXT _ldap._tcp.mydomain.com | ||
| 173 | ))) | ||
| 174 | |||
| 175 | to auto-detect the apropriate {{code language="none"}}ldap(s){{/code}} URI. | ||
| 176 | |||
| 177 | = {{id name="org.clazzes.login.ldap-ManualinstallationinOSGicontainer"/}}Manual installation in OSGi container = | ||
| 178 | |||
| 179 | I some software product has pointed to this page for configuration details, the bundle is probably already installed in the OSGi container the software product runs in. | ||
| 180 | |||
| 181 | OSGi administrators maintaining an individual OSGi container can install the ldap-login-service bundle using these osgi commands: | ||
| 182 | |||
| 183 | (% class="code" %) | ||
| 184 | ((( | ||
| 185 | obr:addurl http:~/~/maven.clazzes.org/repository.xml | ||
| 186 | obr:deploy ldap-login-service | ||
| 187 | ))) | ||
| 188 | |||
| 189 | = {{id name="org.clazzes.login.ldap-Developerinformation"/}}Developer information = | ||
| 190 | |||
| 191 | The maven artifact is: | ||
| 192 | |||
| 193 | (% class="code" %) | ||
| 194 | ((( | ||
| 195 | <groupId>org.clazzes.login</groupId> | ||
| 196 | <artifactId>ldap-login-service</artifactId> | ||
| 197 | ))) | ||
| 198 | |||
| 199 |