forked from mystiq/dex
fixup: document parseAndVerifyTokenClaims behavior
This commit is contained in:
parent
39ee1871e4
commit
12342149d3
1 changed files with 5 additions and 0 deletions
|
@ -448,6 +448,11 @@ type TokenClaims struct {
|
||||||
Claims jose.Claims
|
Claims jose.Claims
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns TokenClaims if and only if
|
||||||
|
// - the given token string is an appropriately formatted JWT
|
||||||
|
// - the JWT contains nonempty "aud" and "sub" claims
|
||||||
|
// - the JWT can be verified for the client associated with the "aud" claim
|
||||||
|
// using the given keys
|
||||||
func parseAndVerifyTokenClaims(token string, issuer url.URL, keys []key.PublicKey) (TokenClaims, error) {
|
func parseAndVerifyTokenClaims(token string, issuer url.URL, keys []key.PublicKey) (TokenClaims, error) {
|
||||||
jwt, err := jose.ParseJWT(token)
|
jwt, err := jose.ParseJWT(token)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue