Documentation ¶
Overview ¶
Package oauth2 provides a middelware that introspects the auth token on behalf of PACE services and populate the request context with useful information when the token is valid, otherwise aborts the request.
Example ¶
Output:
Index ¶
- func BearerToken(ctx context.Context) (string, bool)
- func ClientID(ctx context.Context) (string, bool)
- func HasScope(ctx context.Context, scope string) bool
- func Request(r *http.Request) *http.Request
- func Scopes(ctx context.Context) []string
- func UserID(ctx context.Context) (string, bool)
- type Middleware
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerToken ¶
BearerToken returns the bearer token stored in ctx
Types ¶
type Middleware ¶
type Middleware struct { URL string ClientID string ClientSecret string // contains filtered or unexported fields }
Middleware holds data necessary for Oauth processing
Click to show internal directories.
Click to hide internal directories.