Documentation ¶
Index ¶
- Constants
- func ImplicitFlowURL(c *oauth2.Config, state string, opts ...oauth2.AuthCodeOption) string
- func InferGrantType(oauth2conf *oauth2.Config, oidcConf *OIDCConfiguration) string
- func NewOIDCProvider(issuerURL string, client *http.Client) (*gooidc.Provider, error)
- func OfflineAccess(scopes []string) bool
- type ClientApp
- type OIDCConfiguration
Constants ¶
const ( GrantTypeAuthorizationCode = "authorization_code" GrantTypeImplicit = "implicit" ResponseTypeCode = "code" )
Variables ¶
This section is empty.
Functions ¶
func ImplicitFlowURL ¶
ImplicitFlowURL is an adaptation of oauth2.Config::AuthCodeURL() which returns a URL appropriate for an OAuth2 implicit login flow (as opposed to authorization code flow).
func InferGrantType ¶
func InferGrantType(oauth2conf *oauth2.Config, oidcConf *OIDCConfiguration) string
InferGrantType infers the proper grant flow depending on the OAuth2 client config and OIDC configuration. Returns either: "authorization_code" or "implicit"
func NewOIDCProvider ¶
NewOIDCProvider initializes an OIDC provider, querying the well known oidc configuration path http://example-argocd.com/api/dex/.well-known/openid-configuration
func OfflineAccess ¶
OfflineAccess returns whether or not 'offline_access' is a supported scope
Types ¶
type ClientApp ¶
type ClientApp struct {
// contains filtered or unexported fields
}
func NewClientApp ¶
func NewClientApp(settings *settings.ArgoCDSettings) (*ClientApp, error)
NewClientApp will register the Argo CD client app (either via Dex or external OIDC) and return an object which has HTTP handlers for handling the HTTP responses for login and callback
func (*ClientApp) HandleCallback ¶
func (a *ClientApp) HandleCallback(w http.ResponseWriter, r *http.Request)
HandleCallback is the callback handler for an OAuth2 login flow
func (*ClientApp) HandleLogin ¶
func (a *ClientApp) HandleLogin(w http.ResponseWriter, r *http.Request)
HandleLogin formulates the proper OAuth2 URL (auth code or implicit) and redirects the user to the IDp login & consent page
type OIDCConfiguration ¶
type OIDCConfiguration struct { Issuer string `json:"issuer"` ScopesSupported []string `json:"scopes_supported"` ResponseTypesSupported []string `json:"response_types_supported"` GrantTypesSupported []string `json:"grant_types_supported,omitempty"` }
OIDCConfiguration holds a subset of interested fields from the OIDC configuration spec
func ParseConfig ¶
func ParseConfig(provider *gooidc.Provider) (*OIDCConfiguration, error)
ParseConfig parses the OIDC Config into the concrete datastructure