Go to file
Márk Sági-Kazár e41a28bf27
Merge pull request #3056 from Oded-B/master
Composite claims in OIDC connector
2023-10-25 16:03:03 +02:00
.github build(deps): bump ossf/scorecard-action from 2.3.0 to 2.3.1 (#3169) 2023-10-24 07:33:06 +02:00
api build(deps): bump google.golang.org/grpc in /api/v2 (#3158) 2023-10-20 12:34:41 +02:00
cmd OAuth 2.0 Token Exchange (#2806) 2023-07-01 09:03:08 +02:00
connector Merge pull request #3056 from Oded-B/master 2023-10-25 16:03:03 +02:00
docs spelling: use case 2023-04-27 09:02:32 -04:00
examples Bump ent (v0.12.4) and example app dependencies (#3166) 2023-10-20 16:45:52 +02:00
pkg TLS configure for OIDC connector (#1632) 2022-11-07 13:29:56 +04:00
scripts Utilize native git diff feature (#2981) 2023-06-06 19:40:25 +04:00
server Store offline sessions only if they were requested by the user (#3125) 2023-10-20 07:40:40 +02:00
storage Bump ent (v0.12.4) and example app dependencies (#3166) 2023-10-20 16:45:52 +02:00
web feat: Add default robots.txt (#2834) 2023-02-23 15:53:09 +01:00
.dockerignore chore: cleanup ignore files 2021-01-14 16:27:17 +01:00
.editorconfig chore: add new development configuration 2021-01-28 18:54:38 +01:00
.envrc chore: add direnv 2021-11-14 13:25:04 +01:00
.gitignore chore: update gitignore 2022-06-07 13:39:54 +02:00
.gitpod.yml Fully automate dev setup with Gitpod (#1868) 2020-11-20 01:00:16 +01:00
.golangci.yml chore: fix linter by temporarily disabling failing ones 2023-03-19 17:33:39 +01:00
ADOPTERS.md Add Argo CD to list of Dex adopters 2022-09-30 14:49:49 +02:00
Dockerfile Bump Go 1.21 (#3165) 2023-10-20 12:32:43 +02:00
LICENSE *: add DCO and LICENSE 2016-10-13 11:33:32 -07:00
MAINTAINERS Add @nabokihms to maintainers list 2021-04-27 13:11:15 +04:00
Makefile Utilize native git diff feature (#2981) 2023-06-06 19:40:25 +04:00
README.md Mark refresh as supported by OpenShift connector (#3082) 2023-10-20 12:50:20 +02:00
config.dev.yaml chore: add new development configuration 2021-01-28 18:54:38 +01:00
config.docker.yaml Switch to slim version of a gomplate and add a comment to docker config 2021-02-10 19:44:05 +04:00
config.yaml.dist spelling: against 2023-04-27 09:02:32 -04:00
docker-compose.override.yaml.dist test(connector/ldap): rewrite tests to use a single server instance 2021-02-15 16:37:03 +01:00
docker-compose.test.yaml test(connector/ldap): rewrite tests to use a single server instance 2021-02-15 16:37:03 +01:00
docker-compose.yaml chore: update etcd version in test environments 2021-06-16 00:40:35 +02:00
flake.lock update nix 2023-03-18 14:27:44 +01:00
flake.nix update nix 2023-03-18 14:27:44 +01:00
go.mod build(deps): bump github.com/fsnotify/fsnotify from 1.6.0 to 1.7.0 (#3167) 2023-10-23 11:54:16 +02:00
go.sum build(deps): bump github.com/fsnotify/fsnotify from 1.6.0 to 1.7.0 (#3167) 2023-10-23 11:54:16 +02:00


dex - A federated OpenID Connect provider

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


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 attest to the end user's identity. An example JWT might look like:


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

  "iss": "",
  "sub": "CgcyMzQyNzQ5EgZnaXRodWI",
  "aud": "example-app",
  "exp": 1492882042,
  "iat": 1492795642,
  "at_hash": "bi96gOXZShvlWYtal9Eqiw",
  "email": "jane.doe@coreos.com",
  "email_verified": true,
  "groups": [
  "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 uses dex, here.


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.


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:


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.


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