MCPcopy Index your code
hub / github.com/dexidp/dex

github.com/dexidp/dex @v2.45.1

repository ↗ · DeepWiki ↗ · release v2.45.1 ↗ · + Follow
6,041 symbols 14,783 edges 248 files 4,201 documented · 70% 2 cross-repo links updated 1d agov2.45.1 · 2026-03-03★ 10,943341 open issues
README

dex - A federated OpenID Connect provider

GitHub Workflow Status OpenSSF Scorecard Go Report Card Gitpod ready-to-code

logo

Dex is an identity service that uses OpenID Connect to drive authentication for other apps.

Dex acts as a portal to other identity providers through "connectors." This lets dex defer authentication to LDAP servers, SAML providers, or established identity providers like GitHub, Google, and Active Directory. Clients write their authentication logic once to talk to dex, then dex handles the protocols for a given backend.

ID Tokens

ID Tokens are an OAuth2 extension introduced by OpenID Connect and dex's primary feature. ID Tokens are JSON Web Tokens (JWTs) signed by dex and returned as part of the OAuth2 response that attests to the end user's identity. An example JWT might look like:

eyJhbGciOiJSUzI1NiIsImtpZCI6IjlkNDQ3NDFmNzczYjkzOGNmNjVkZDMyNjY4NWI4NjE4MGMzMjRkOTkifQ.eyJpc3MiOiJodHRwOi8vMTI3LjAuMC4xOjU1NTYvZGV4Iiwic3ViIjoiQ2djeU16UXlOelE1RWdabmFYUm9kV0kiLCJhdWQiOiJleGFtcGxlLWFwcCIsImV4cCI6MTQ5Mjg4MjA0MiwiaWF0IjoxNDkyNzk1NjQyLCJhdF9oYXNoIjoiYmk5NmdPWFpTaHZsV1l0YWw5RXFpdyIsImVtYWlsIjoiZXJpYy5jaGlhbmdAY29yZW9zLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJncm91cHMiOlsiYWRtaW5zIiwiZGV2ZWxvcGVycyJdLCJuYW1lIjoiRXJpYyBDaGlhbmcifQ.OhROPq_0eP-zsQRjg87KZ4wGkjiQGnTi5QuG877AdJDb3R2ZCOk2Vkf5SdP8cPyb3VMqL32G4hLDayniiv8f1_ZXAde0sKrayfQ10XAXFgZl_P1yilkLdknxn6nbhDRVllpWcB12ki9vmAxklAr0B1C4kr5nI3-BZLrFcUR5sQbxwJj4oW1OuG6jJCNGHXGNTBTNEaM28eD-9nhfBeuBTzzO7BKwPsojjj4C9ogU4JQhGvm_l4yfVi0boSx8c0FX3JsiB0yLa1ZdJVWVl9m90XmbWRSD85pNDQHcWZP9hR6CMgbvGkZsgjG32qeRwUL_eNkNowSBNWLrGNPoON1gMg

ID Tokens contains standard claims assert which client app logged the user in, when the token expires, and the identity of the user.

{
  "iss": "http://127.0.0.1:5556/dex",
  "sub": "CgcyMzQyNzQ5EgZnaXRodWI",
  "aud": "example-app",
  "exp": 1492882042,
  "iat": 1492795642,
  "at_hash": "bi96gOXZShvlWYtal9Eqiw",
  "email": "jane.doe@coreos.com",
  "email_verified": true,
  "groups": [
    "admins",
    "developers"
  ],
  "name": "Jane Doe"
}

Because these tokens are signed by dex and contain standard-based claims other services can consume them as service-to-service credentials. Systems that can already consume OpenID Connect ID Tokens issued by dex include:

For details on how to request or validate an ID Token, see "Writing apps that use dex".

Kubernetes and Dex

Dex runs natively on top of any Kubernetes cluster using Custom Resource Definitions and can drive API server authentication through the OpenID Connect plugin. Clients, such as the kubernetes-dashboard and kubectl, can act on behalf of users who can login to the cluster through any identity provider dex supports.

  • More docs for running dex as a Kubernetes authenticator can be found here.
  • You can find more about companies and projects which use dex, here.

Connectors

When a user logs in through dex, the user's identity is usually stored in another user-management system: a LDAP directory, a GitHub org, etc. Dex acts as a shim between a client app and the upstream identity provider. The client only needs to understand OpenID Connect to query dex, while dex implements an array of protocols for querying other user-management systems.

A "connector" is a strategy used by dex for authenticating a user against another identity provider. Dex implements connectors that target specific platforms such as GitHub, LinkedIn, and Microsoft as well as established protocols like LDAP and SAML.

Depending on the connectors limitations in protocols can prevent dex from issuing refresh tokens or returning group membership claims. For example, because SAML doesn't provide a non-interactive way to refresh assertions, if a user logs in through the SAML connector dex won't issue a refresh token to its client. Refresh token support is required for clients that require offline access, such as kubectl.

Dex implements the following connectors:

Name supports refresh tokens supports groups claim supports preferred_username claim status notes
LDAP yes yes yes stable
GitHub yes yes yes stable
SAML 2.0 no yes no stable WARNING: Unmaintained and likely vulnerable to auth bypasses (#1884)
GitLab yes yes yes beta
OpenID Connect yes yes yes beta Includes Salesforce, Azure, etc.
OAuth 2.0 no yes yes alpha
Google yes yes yes alpha
LinkedIn yes no no beta
Microsoft yes yes no beta
AuthProxy no yes no alpha Authentication proxies such as Apache2 mod_auth, etc.
Bitbucket Cloud yes yes no alpha
OpenShift yes yes no alpha
Atlassian Crowd yes yes yes * beta preferred_username claim must be configured through config
Gitea yes no yes beta
OpenStack Keystone yes yes no alpha

Stable, beta, and alpha are defined as:

  • Stable: well tested, in active use, and will not change in backward incompatible ways.
  • Beta: tested and unlikely to change in backward incompatible ways.
  • Alpha: may be untested by core maintainers and is subject to change in backward incompatible ways.

All changes or deprecations of connector features will be announced in the release notes.

Documentation

Reporting a vulnerability

Please see our security policy for details about reporting vulnerabilities.

Getting help

  • For feature requests and bugs, file an issue.
  • For general discussion about both using and developing Dex:

Development

When all coding and testing is done, please run the test suite:

make testall

For the best developer experience, install Nix and direnv.

Alternatively, install Go and Docker manually or using a package manager. Install the rest of the dependencies by running make deps.

For release process, please read the release documentation.

License

The project is licensed under the Apache License, Version 2.0.

Extension points exported contracts — how you extend this code

CallbackConnector (Interface)
CallbackConnector is an interface implemented by connectors which use an OAuth style redirect flow to determine user inf [12 …
connector/connector.go
StorageConfig (Interface)
StorageConfig is a configuration that can create a storage. [29 implementers]
cmd/dex/config.go
ConnectorConfig (Interface)
ConnectorConfig is a configuration that can open a connector. [29 implementers]
server/server.go
Storage (Interface)
Storage is the storage interface used by the server. Implementations are required to be able to perform atomic compare-a [5 …
storage/storage.go
Signer (Interface)
Signer is an interface for signing payloads and retrieving validation keys. [3 implementers]
server/signer/signer.go
Committer (Interface)
Committer is the interface that wraps the Commit method. [2 implementers]
storage/ent/db/tx.go
RefreshConnector (Interface)
RefreshConnector is a connector that can update the client claims. [16 implementers]
connector/connector.go
SignerConfig (Interface)
SignerConfig is a configuration that can create a signer.
cmd/dex/config.go

Core symbols most depended-on inside this repo

SetField
called by 270
storage/ent/db/mutation.go
Close
called by 210
storage/storage.go
Error
called by 195
storage/ent/db/enttest/enttest.go
Get
called by 193
storage/ent/db/client.go
Is
called by 116
server/introspectionhandler.go
Equal
called by 109
storage/kubernetes/k8sapi/time.go
setContextOp
called by 100
storage/ent/db/ent.go
tokenErrHelper
called by 82
server/handlers.go

Shape

Method 3,533
Function 1,871
Struct 536
FuncType 53
Interface 24
TypeAlias 24

Languages

Go100%
TypeScript1%

Modules by API surface

storage/ent/db/mutation.go757 symbols
api/v2/api.pb.go334 symbols
storage/ent/db/authrequest/where.go212 symbols
storage/ent/db/client.go210 symbols
api/api.pb.go200 symbols
storage/ent/db/authcode/where.go181 symbols
storage/ent/db/refreshtoken/where.go176 symbols
storage/ent/db/devicetoken/where.go106 symbols
storage/ent/db/authrequest_update.go101 symbols
api/v2/api_grpc.pb.go101 symbols
storage/ent/db/password/where.go98 symbols
storage/ent/db/refreshtoken_update.go83 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

ariga.io/atlasv0.32.1-0.2025032510 · 1×
cloud.google.com/go/auth/oauth2adaptv0.2.8 · 1×
cloud.google.com/go/compute/metadatav0.9.0 · 1×
dario.cat/mergov1.0.1 · 1×
entgo.io/entv0.14.5 · 1×
filippo.io/edwards25519v1.1.1 · 1×
github.com/AppsFlyer/go-sundheitv0.6.0 · 1×
github.com/Azure/go-ntlmsspv0.0.0-2022112819355 · 1×
github.com/Masterminds/goutilsv1.1.1 · 1×
github.com/Masterminds/semverv1.5.0 · 1×
github.com/Masterminds/semver/v3v3.3.0 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add dex \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact