{{define "content"}} {{if .User}}
Signed in
{{if .User.Name}}
Name
{{.User.Name}}
{{end}} {{if .User.Email}}
Email
{{.User.Email}}
{{end}}
Subject
{{.User.Subject}}
{{if .User.SessionID}}
Session (sid)
{{.User.SessionID}}
{{end}} {{with .Token}}
Access token
{{.AccessToken}}
{{if .Expiry}}
Expires
{{.Expiry}}{{if .Expired}} — expired, refreshing on next load{{end}}
{{end}}
Refresh token
{{if .RefreshToken}}held{{else}}none — request offline_access to get one{{end}}
{{end}}
Inspect tokens Log out
{{if .SessionCheck}}

Re-checked with the provider every {{.SessionCheck}} using prompt=none, so signing out of dex elsewhere ends this session too.

{{end}}
{{end}} {{/* Rendered whichever way round, so a back-channel logout can swap the two without the page having to build markup the template already owns. */}}
Not signed in

The example client for dex. Pick a flow to run it and see what comes back. Configuration for each one is in the README.

Flows through the browser
Authorization request options

These apply to both flows above.

{{range .ScopesSupported}}
{{end}}
{{if eq (len .ScopesSupported) 0}} The provider advertises no scopes — add them by hand. {{end}}
openid is always requested. offline_access is what gets you a refresh token.
Sent as audience:server:client_id:<id>, which asks dex for a token another client will accept.
Skips dex's connector selection screen.
Flows without a browser

These call the token endpoint directly. Each one asks for its own parameters.

{{if not (or .ClientCredentialsSupported .RefreshSupported .TokenExchangeSupported .PasswordSupported)}}

The provider advertises none of these grants. oauth2.grantTypes in dex's config decides.

{{end}}
{{end}}