Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: LDAP connector documentation. #690

Merged
merged 1 commit into from
Nov 17, 2016

Conversation

rithujohn191
Copy link
Contributor

No description provided.

@rithujohn191
Copy link
Contributor Author

@ericchiang.

Copy link
Contributor

@ericchiang ericchiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the draft. Lots of comments.

@@ -0,0 +1,86 @@
# Overview of the `ldap` Connector

The `ldap` connector allows email/password based authentication hosted by dex, backed by a LDAP directory. All the configuration parameters required by the `ldap` connector are held in [Config struct](../connector/ldap/ldap.go).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need hosted by dex

1. Finding the user based on the end user's credentials.
2. Searching for groups using the user entry.

User entries are expected to have an email attribute (configurable through "emailAttr"), and a display name attribute (configurable through "nameAttr").
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emaliAttr and nameAttr (use a backquote)

@@ -0,0 +1,86 @@
# Overview of the `ldap` Connector
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title should be something like "Authentication through LDAP"

Then we would have a ## Overview subsection


User entries are expected to have an email attribute (configurable through "emailAttr"), and a display name attribute (configurable through "nameAttr").

### Setting the Configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be combined with the next section. Also we can probably just use "Configuration" as the header. Also two "#", not three.


### Example: User authentication

The following is an example config file that can be used by the `ldap` connector to submit a [SearchRequest](https://godoc.org/gopkg.in/ldap.v2#SearchRequest) to authenticate a user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to refer to the upstream client. It's an implementation detail that we don't expose.

# insecureNoSSL: true
# Default: use the host's root CA set.
rootCA: /etc/dex/ldap.ca
# DN to bind as for search operations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that these are optional and not required if your LDAP server provides sufficient access for anonymous auth.

# Required. Attribute to map to Email.
emailAttr: mail
# Maps to display name of users.
nameAttr: name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no group search?


```yaml

connectors:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un-indent this so users can just copy paste it into their config.


### Setting the Configuration

To set the `ldap` connector configuration in dex, create a config file at `example/config-ldap.yaml`, then use the following command to start an instance of dex:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to explain this here. This should be something like "in your dex config file" with a link to the getting started guide. https://github.com/coreos/dex/blob/master/Documentation/getting-started.md

bindPW: password
userSearch:
# Would translate to the query "(&(objectClass=person)(uid=<username>))".
baseDN: cn=users,dc=example,dc=com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to comment these fields waaaay more.

@rithujohn191
Copy link
Contributor Author

YAML does not allow extra lines between attributes :(

Copy link
Contributor

@ericchiang ericchiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple more nits. Would you mind addressing those then we can merge it?


## Overview

The LDAP connector allows email/password based authentication, backed by a LDAP directory. All the configuration parameters required by the connector are held in [Config struct](../connector/ldap/ldap.go).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to link to source code here. Probably just cut the second sentence.

1. Finding the user based on the end user's credentials.
2. Searching for groups using the user entry.

## Example: User authentication
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just name this section Configuration


User entries are expected to have an email attribute (configurable through `emailAttr`), and a display name attribute (configurable through `nameAttr`). The following is an example config file that can be used by the LDAP connector to authenticate a user.

```yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For inline comments, don't add a newline a the end of every sentence, add it add it at about 80 characters.

For example, don't do this:

# The DN and password for an application service account.
# The connector uses these credentials to search for users and groups.
# Optional. Not required if the LDAP server provides access for anonymous auth.

Do this:

# The DN and password for an application service account. The connector uses
# these credentials to search for users and groups. Not required if the LDAP
# server provides access for anonymous auth.

@Calpicow
Copy link
Contributor

I've found that the id attribute also needs to be set for it to work at all.

@ericchiang
Copy link
Contributor

Ah you're totally right, I think we even check that earlier now that #686 is in.

@rithujohn191
Copy link
Contributor Author

Thanks @Calpicow

@ericchiang
Copy link
Contributor

lgtm

@ericchiang ericchiang merged commit 2e74b48 into dexidp:master Nov 17, 2016
@rithujohn191 rithujohn191 deleted the connector-docs branch November 17, 2016 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants