Documentation
¶
Index ¶
Constants ¶
View Source
const ClaimsKey = "claims"
ClaimsKey is the key into the http context for retrieving claims
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { Issuer string RequiredScopes []string CustomValidator func(*Claims) error // contains filtered or unexported fields }
Auth implements http middleware for parsing and verifying oauth2 bearer tokens
func (*Auth) WithBearerToken ¶
func (j *Auth) WithBearerToken(next http.HandlerFunc) http.HandlerFunc
WithBearerToken is a middleware implementation that will look for a bearer token, parsie it, and verify it. If sussessful, the resulting Claims will be dropped into the request context as "claims"
type Claims ¶
type Claims struct { jwt.StandardClaims Scopes []string `json:"scope,omitempty"` }
Claims are an extension fo the jwt.StandardClaims
type ClaimsType ¶
type ClaimsType string
ClaimsType is a wrapper type for storing values in the http.Request context
Click to show internal directories.
Click to hide internal directories.