Skip to content

How to Fix Dex IDP Connector Configuration Error

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Dex IDP Connector Configuration Error. We cover key concepts, practical examples, and best practices.

Dex connector shows Failed to create connector or Connector "ldap" not found on startup — the connector configuration file has invalid YAML or missing required fields.

The Problem

time="2026-06-24T10:00:00Z" level=fatal msg="Failed to create connector:"
error="invalid connector config: either 'host' or 'config' must be set"

Step-by-Step Fix

Step 1: Configure LDAP connector

# /etc/dex/config.yaml
connectors:
  - type: ldap
    id: ldap
    name: LDAP
    config:
      host: ldap.example.com:389
      insecureNoSSL: true
      bindDN: cn=admin,dc=example,dc=com
      bindPW: password
      userSearch:
        baseDN: ou=users,dc=example,dc=com
        filter: "(objectClass=person)"
        username: cn
        idAttr: DN
        emailAttr: mail
        nameAttr: cn
      groupSearch:
        baseDN: ou=groups,dc=example,dc=com
        filter: "(objectClass=group)"
        userAttr: DN
        groupAttr: member
        groupNameAttr: cn

Step 2: Configure OIDC connector

connectors:
  - type: oidc
    id: google
    name: Google
    config:
      issuer: https://accounts.google.com
      clientID: YOUR_CLIENT_ID
      clientSecret: YOUR_CLIENT_SECRET
      redirectURI: https://dex.example.com/callback
      scopes:
        - openid
        - profile
        - email

Step 3: Set callback URL

issuer: https://dex.example.com

# The redirectURI in the connector must match:
# https://dex.example.com/callback

Step 4: Validate config

dex serve /etc/dex/config.yaml --validate

Step 5: Test connector

# Start Dex
dex serve /etc/dex/config.yaml

# Test authentication
curl -v https://dex.example.com/auth?client_id=...&response_type=code

Step 6: Check connector logs

sudo journalctl -u dex -f

Prevention Tips

  • Validate config with dex serve config.yaml --validate before deploying
  • Test OIDC connectors with a local provider first
  • Use environment variables for secrets: clientSecret: $CLIENT_SECRET
  • Monitor Dex logs for connector health

Common Mistakes with connector error

  1. Using foldl instead of foldl' causing stack overflow on large lists
  2. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  3. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable

These mistakes appear frequently in real-world DEX code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does Dex fail with "Connector not found"?

The type field must match one of Dex's supported connectors. Check the Dex documentation for supported types: ldap, oidc, saml, github, gitlab, microsoft, linkedin. Also ensure the config file is valid YAML.

How do I configure Dex with multiple connectors?

List multiple connector blocks under the connectors: field. Each must have a unique id. Users see a list of connectors on the login page. The first connector is the default.

What callback URL should I use for Dex connectors?

The callback URL must be <dex-issuer>/callback. For example, if issuer: https://dex.example.com, the callback is https://dex.example.com/callback. This URL must be registered in the OIDC provider.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro