func (oe *OIDCExtra) AddFlags(cmd *cobra.Command) {
	cmd.Flags().StringSlice("oidc-extra-scopes", nil, "[DEPRECATED] List of extra scopes to ask. Use oidc.scopes option instead. Option will be removed in next release.")
	cmd.Flags().StringToString("oidc-extra-authcodeopts", nil, "K/V list of extra authorisation code to include in token request")
}
AddFlags init oidc extra flags
package config
import (
	"github.com/spf13/cobra"
)
type App struct {
	Name     string
	Listen   string
	Secret   string
	OIDC     OIDC
	TLS      TLS
	Web      Web
	Metrics  Metrics
	Clusters []Cluster
}
func (a *App) AddFlags(cmd *cobra.Command) {
	cmd.Flags().StringP("name", "n", "Loginapp", "Application name. Used for web title.")
	cmd.Flags().StringP("listen", "l", "0.0.0.0:8080", "Listen interface and port")
	cmd.Flags().StringP("secret", "s", "", "Application secret. Must be identical across all loginapp server replicas (this is not the OIDC Client secret)")
	a.OIDC.AddFlags(cmd)
	a.TLS.AddFlags(cmd)
	a.Web.AddFlags(cmd)
	a.Metrics.AddFlags(cmd)
}
type OIDC struct {
	Client         OIDCClient
	Issuer         OIDCIssuer
	Extra          OIDCExtra
	OfflineAsScope bool
	CrossClients   []string
	Scopes         []string
}
func (o *OIDC) AddFlags(cmd *cobra.Command) {
	cmd.Flags().Bool("oidc-offlineasscope", false, "Issue a refresh token for offline access")
	cmd.Flags().StringSlice("oidc-crossclients", nil, "Issue token on behalf of this list of client IDs")
	cmd.Flags().StringSlice("oidc-scopes", []string{"openid", "profile", "email", "groups"}, "List of scopes to request. Updating this parameter will override existing scopes.")
	o.Client.AddFlags(cmd)
	o.Issuer.AddFlags(cmd)
	o.Extra.AddFlags(cmd)
}
type OIDCClient struct {
	ID          string
	Secret      string
	RedirectURL string
}
func (oc *OIDCClient) AddFlags(cmd *cobra.Command) {
	cmd.Flags().String("oidc-client-id", "loginapp", "Client ID")
	cmd.Flags().String("oidc-client-secret", "", "Client secret")
	cmd.Flags().String("oidc-client-redirecturl", "", "Redirect URL for callback. This must be the same than the one provided to the IDP. Must end with '/callback'")
}
type OIDCIssuer struct {
	URL                string
	RootCA             string
	InsecureSkipVerify bool
}
func (oi *OIDCIssuer) AddFlags(cmd *cobra.Command) {
	cmd.Flags().String("oidc-issuer-url", "", "Full URL of issuer before '/.well-known/openid-configuration' path")
	cmd.Flags().String("oidc-issuer-rootca", "", "Certificate authority of the issuer")
	cmd.Flags().Bool("oidc-issuer-insecureskipverify", false, "Skip issuer certificate validation (usefull for testing). It is not advised to use this option in production")
}
type OIDCExtra struct {
	Scopes       []string
	AuthCodeOpts map[string]string
}