Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT custom claims validation #827

Closed
madshov opened this issue Jan 16, 2019 · 0 comments
Closed

JWT custom claims validation #827

madshov opened this issue Jan 16, 2019 · 0 comments

Comments

@madshov
Copy link

madshov commented Jan 16, 2019

Using JWT, where am I suppose to validate claims like jti and other custom claims?

type customClaims struct {
	Foo string `json:"foo"`
	jwt.StandardClaims
}

func (c *customClaims) Valid() error {
	err := c.StandardClaims.Valid()
        if err != nil {
                return err
        }
	return nil
}

func customClaimsFactory() jwt.Claims {
	return &customClaims{}
}

endpoint = kitjwt.NewParser(
	func(token *jwt.Token) (interface{}, error) {
		return []byte("mystring"), nil
	},
	jwt.SigningMethodHS256,
	customClaimsFactory,
)(endpoint)

I'm not able to access context and request data anywhere. Is there an example I can look at?

@go-kit go-kit locked and limited conversation to collaborators Jul 17, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants