You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
4.6 KiB
123 lines
4.6 KiB
3 years ago
|
# Gitea LDAP Authentication Module
|
||
11 years ago
|
|
||
10 years ago
|
## About
|
||
11 years ago
|
|
||
10 years ago
|
This authentication module attempts to authorize and authenticate a user
|
||
9 years ago
|
against an LDAP server. It provides two methods of authentication: LDAP via
|
||
9 years ago
|
BindDN, and LDAP simple authentication.
|
||
|
|
||
9 years ago
|
LDAP via BindDN functions like most LDAP authentication systems. First, it
|
||
|
queries the LDAP server using a Bind DN and searches for the user that is
|
||
|
attempting to sign in. If the user is found, the module attempts to bind to the
|
||
|
server using the user's supplied credentials. If this succeeds, the user has
|
||
|
been authenticated, and his account information is retrieved and passed to the
|
||
|
Gogs login infrastructure.
|
||
11 years ago
|
|
||
9 years ago
|
LDAP simple authentication does not utilize a Bind DN. Instead, it binds
|
||
|
directly with the LDAP server using the user's supplied credentials. If the bind
|
||
|
succeeds and no filter rules out the user, the user is authenticated.
|
||
|
|
||
|
LDAP via BindDN is recommended for most users. By using a Bind DN, the server
|
||
|
can perform authorization by restricting which entries the Bind DN account can
|
||
|
read. Further, using a Bind DN with reduced permissions can reduce security risk
|
||
|
in the face of application bugs.
|
||
|
|
||
10 years ago
|
## Usage
|
||
11 years ago
|
|
||
10 years ago
|
To use this module, add an LDAP authentication source via the Authentications
|
||
9 years ago
|
section in the admin panel. Both the LDAP via BindDN and the simple auth LDAP
|
||
|
share the following fields:
|
||
11 years ago
|
|
||
10 years ago
|
* Authorization Name **(required)**
|
||
3 years ago
|
* A name to assign to the new method of authorization.
|
||
11 years ago
|
|
||
10 years ago
|
* Host **(required)**
|
||
3 years ago
|
* The address where the LDAP server can be reached.
|
||
|
* Example: mydomain.com
|
||
10 years ago
|
|
||
10 years ago
|
* Port **(required)**
|
||
3 years ago
|
* The port to use when connecting to the server.
|
||
|
* Example: 636
|
||
11 years ago
|
|
||
10 years ago
|
* Enable TLS Encryption (optional)
|
||
3 years ago
|
* Whether to use TLS when connecting to the LDAP server.
|
||
9 years ago
|
|
||
|
* Admin Filter (optional)
|
||
3 years ago
|
* An LDAP filter specifying if a user should be given administrator
|
||
9 years ago
|
privileges. If a user accounts passes the filter, the user will be
|
||
|
privileged as an administrator.
|
||
3 years ago
|
* Example: (objectClass=adminAccount)
|
||
9 years ago
|
|
||
|
* First name attribute (optional)
|
||
3 years ago
|
* The attribute of the user's LDAP record containing the user's first name.
|
||
9 years ago
|
This will be used to populate their account information.
|
||
3 years ago
|
* Example: givenName
|
||
9 years ago
|
|
||
|
* Surname attribute (optional)
|
||
3 years ago
|
* The attribute of the user's LDAP record containing the user's surname This
|
||
9 years ago
|
will be used to populate their account information.
|
||
3 years ago
|
* Example: sn
|
||
9 years ago
|
|
||
|
* E-mail attribute **(required)**
|
||
3 years ago
|
* The attribute of the user's LDAP record containing the user's email
|
||
9 years ago
|
address. This will be used to populate their account information.
|
||
3 years ago
|
* Example: mail
|
||
9 years ago
|
|
||
|
**LDAP via BindDN** adds the following fields:
|
||
11 years ago
|
|
||
10 years ago
|
* Bind DN (optional)
|
||
3 years ago
|
* The DN to bind to the LDAP server with when searching for the user. This
|
||
9 years ago
|
may be left blank to perform an anonymous search.
|
||
3 years ago
|
* Example: cn=Search,dc=mydomain,dc=com
|
||
11 years ago
|
|
||
10 years ago
|
* Bind Password (optional)
|
||
3 years ago
|
* The password for the Bind DN specified above, if any. _Note: The password
|
||
9 years ago
|
is stored in plaintext at the server. As such, ensure that your Bind DN
|
||
|
has as few privileges as possible._
|
||
11 years ago
|
|
||
10 years ago
|
* User Search Base **(required)**
|
||
3 years ago
|
* The LDAP base at which user accounts will be searched for.
|
||
|
* Example: ou=Users,dc=mydomain,dc=com
|
||
11 years ago
|
|
||
10 years ago
|
* User Filter **(required)**
|
||
3 years ago
|
* An LDAP filter declaring how to find the user record that is attempting to
|
||
9 years ago
|
authenticate. The '%s' matching parameter will be substituted with the
|
||
|
user's username.
|
||
3 years ago
|
* Example: (&(objectClass=posixAccount)(uid=%s))
|
||
11 years ago
|
|
||
9 years ago
|
**LDAP using simple auth** adds the following fields:
|
||
11 years ago
|
|
||
9 years ago
|
* User DN **(required)**
|
||
3 years ago
|
* A template to use as the user's DN. The `%s` matching parameter will be
|
||
9 years ago
|
substituted with the user's username.
|
||
3 years ago
|
* Example: cn=%s,ou=Users,dc=mydomain,dc=com
|
||
|
* Example: uid=%s,ou=Users,dc=mydomain,dc=com
|
||
11 years ago
|
|
||
6 years ago
|
* User Search Base (optional)
|
||
3 years ago
|
* The LDAP base at which user accounts will be searched for.
|
||
|
* Example: ou=Users,dc=mydomain,dc=com
|
||
6 years ago
|
|
||
9 years ago
|
* User Filter **(required)**
|
||
3 years ago
|
* An LDAP filter declaring when a user should be allowed to log in. The `%s`
|
||
9 years ago
|
matching parameter will be substituted with the user's username.
|
||
3 years ago
|
* Example: (&(objectClass=posixAccount)(cn=%s))
|
||
|
* Example: (&(objectClass=posixAccount)(uid=%s))
|
||
4 years ago
|
|
||
|
**Verify group membership in LDAP** uses the following fields:
|
||
|
|
||
|
* Group Search Base (optional)
|
||
3 years ago
|
* The LDAP DN used for groups.
|
||
|
* Example: ou=group,dc=mydomain,dc=com
|
||
4 years ago
|
|
||
|
* Group Name Filter (optional)
|
||
3 years ago
|
* An LDAP filter declaring how to find valid groups in the above DN.
|
||
|
* Example: (|(cn=gitea_users)(cn=admins))
|
||
4 years ago
|
|
||
|
* User Attribute in Group (optional)
|
||
3 years ago
|
* Which user LDAP attribute is listed in the group.
|
||
|
* Example: uid
|
||
4 years ago
|
|
||
|
* Group Attribute for User (optional)
|
||
3 years ago
|
* Which group LDAP attribute contains an array above user attribute names.
|
||
|
* Example: memberUid
|