Documentation ¶
Index ¶
- Variables
- func Authorized(a *dexApp, req *http.Request) (bool, error)
- func Cmd() *cobra.Command
- func GetOauth2Token(a *dexApp, r *http.Request) (*oauth2.Token, *jwt.Token, error)
- func NewAuthCodeURL(a *dexApp, r *http.Request) (string, error)
- func ParseAuthEnv() error
- func ParseJWT(token string, hmacSecret string) (*jwt.Token, error)
- type OAuth2Config
- type Verifier
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthServerEnvConf *envAuthServerConfig
AuthServerEnvConf stores the loaded environment variables
Functions ¶
func Authorized ¶
Authorized tests an http request for the Authorization: Bearer [token] header and returns whether or not it's allowed to execute that request
func GetOauth2Token ¶
GetOauth2Token obtains a new oauth2Token from dex
func NewAuthCodeURL ¶
NewAuthCodeURL make a new authCodeURL with "rd" query, scopes, and stateToken
func ParseAuthEnv ¶
func ParseAuthEnv() error
ParseAuthEnv parses the environment variables for the auth server
Types ¶
type OAuth2Config ¶
type OAuth2Config interface { GenerateAuthCodeURL(tokenString string, scopes []string, options []oauth2.AuthCodeOption) string ExchangeCodeForToken(ctx context.Context, code string) (*oauth2.Token, error) ExchangeRefreshForToken(ctx context.Context, refresh *oauth2.Token) (*oauth2.Token, error) GetTokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource }
OAuth2Config provides an interface to perform standard OAuth2 functions with a provider
Source Files ¶
Click to show internal directories.
Click to hide internal directories.