Documentation ¶
Index ¶
Constants ¶
View Source
const (
// CallbackPath is the API path for receiving callback tokens from external OIDC providers
CallbackPath = "/auth/callback"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct { Sub string `json:"sub"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` Groups []string `json:"groups"` Name string `json:"name"` PreferredUsername string `json:"preferred_username"` }
Claims represents claims as found in an id_token returned from an OIDC flow.
type IDP ¶
type IDP interface { // HandleCallback accepts a context (pass the context from the http.Request), and an oauth2 code as returned from a successful // login through an OIDC provider. It uses the code to request a token from the OIDC provider, which should contain an id_token // with a set of claims. // // Note that this function *does not* verify state. That should be handled by the caller *before* this function is called. HandleCallback(ctx context.Context, code string) (*Claims, gtserror.WithCode) // AuthCodeURL returns the proper redirect URL for this IDP, for redirecting requesters to the correct OIDC endpoint. AuthCodeURL(state string) string }
IDP contains logic for parsing an OIDC access code into a set of claims by calling an external OIDC provider.
Click to show internal directories.
Click to hide internal directories.