Documentation ¶
Index ¶
Constants ¶
View Source
const ( RS256 = "RS256" SIG = "sig" )
View Source
const ( JWT = "JWT" KID = "kid" BEARER = "bearer" )
Variables ¶
This section is empty.
Functions ¶
func NewJSONWebKeySet ¶
NewJSONWebKeySet provides a single-key set with a kid value
Types ¶
type AccessToken ¶
type SimpleIssuer ¶
type SimpleIssuer struct { Name string Audience string Signer jose.Signer Keys jose.JSONWebKeySet NotBefore time.Time TokenTTL time.Duration }
func NewSimpleIssuer ¶
func NewSimpleIssuer(private *rsa.PrivateKey, name string, audience string, start time.Time, ttl time.Duration) SimpleIssuer
NewSimpleIssuer a jwt signer and matching jwks given a rsa key pair, iss name, aud name, start time, and jwt ttl
func (*SimpleIssuer) IssueAccessToken ¶
func (s *SimpleIssuer) IssueAccessToken(subject string, audience string) (*AccessToken, error)
IssueAccessToken creates a signed jwt given a subject and audience for 'sub' and 'aud' claims
func (*SimpleIssuer) JWKSHandler ¶
func (s *SimpleIssuer) JWKSHandler(w http.ResponseWriter, r *http.Request)
JWKSHandler a matching HTTP endpoint for hosting jwks
Click to show internal directories.
Click to hide internal directories.