ldap

package module
v0.0.0-...-eb5191d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

LDAP connector

LDAP connector is a plug-in designed to support login via LDAP or Active Directory, including LDAPS and StartTLS.

How to use

Build
./answer build --with github.com/apache/answer-plugins/connector-ldap
Configuration
  • Name - Display name for the connector shown on the login page
  • Server - LDAP server URL, e.g. ldaps://ldap.example.com:636 or ldap://ldap.example.com:389
  • Base DN - Base DN to search for users, e.g. dc=example,dc=com
  • Bind DN - DN of the service account used to bind and search the directory
  • Bind Password - Password for the bind DN
  • User Attribute - LDAP attribute holding the username, e.g. uid for OpenLDAP or sAMAccountName for Active Directory
  • TLS CA Certificate Path - Optional path to a custom CA certificate, used to verify the LDAP server's certificate (e.g. for a private/internal CA)

If the server URL starts with ldaps://, the connection is established over TLS directly. Otherwise, a plain connection is opened and upgraded via StartTLS.

Users must have a mail attribute set in LDAP, since it is required to create/match the Answer account on login.

Documentation

Index

Constants

View Source
const (
	LdapAttributeDn             = "dn"
	LdapAttributeUid            = "uid"
	LdapAttributeCn             = "cn"
	LdapAttributeMail           = "mail"
	LdapAttributeDisplayName    = "displayName"
	LdapAttributeSamAccountName = "sAMAccountName"
	LdapAttributeObjectGUID     = "objectGUID"

	DefaultExternalIDAttr = "entryUUID"
)

Variables

View Source
var Info embed.FS

Functions

This section is empty.

Types

type Connector

type Connector struct {
	Config *ConnectorConfig
}

func (*Connector) ConfigFields

func (g *Connector) ConfigFields() []plugin.ConfigField

func (*Connector) ConfigReceiver

func (g *Connector) ConfigReceiver(config []byte) error

func (*Connector) ConnectorLogoSVG

func (g *Connector) ConnectorLogoSVG() string

func (*Connector) ConnectorName

func (g *Connector) ConnectorName() plugin.Translator

func (*Connector) ConnectorReceiver

func (c *Connector) ConnectorReceiver(ctx *plugin.GinContext, receiverURL string) (userInfo plugin.ExternalLoginUserInfo, err error)

func (*Connector) ConnectorRequireState

func (g *Connector) ConnectorRequireState() bool

func (*Connector) ConnectorSender

func (g *Connector) ConnectorSender(ctx *plugin.GinContext, receiverURL string) string

func (*Connector) ConnectorSlugName

func (g *Connector) ConnectorSlugName() string

func (*Connector) Info

func (g *Connector) Info() plugin.Info

type ConnectorConfig

type ConnectorConfig struct {
	Name           string `json:"name"`
	Server         string `json:"server"`
	BaseDN         string `json:"base_dn"`
	BindDN         string `json:"bind_dn"`
	BindPassword   string `json:"bind_password"`
	UserAttr       string `json:"user_attr"`
	ExternalIDAttr string `json:"external_id_attr"`
	TLSCACertPath  string `json:"tls_ca_cert_path"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL