Re: [go-nuts] JWT validation only in Middleware

2019-09-27 Thread Matt-Klaus Mush
While trying to make Go my #1 backend language, I decided to build an API authentication app, since most of the applications I work on require it. Have a look at my code on Github (at https://github.com/mmattklaus/go-jwt-demo), and see how I approached it. I documented every bit. Hopefully, it'll

Re: [go-nuts] JWT validation only in Middleware

2019-09-27 Thread Martin Palma
Yes the handler are arranged as follows: OAuth2Middleware (JWT token creation on login / JWT validation) -> InputValidationMiddleware (decoding and validating user input and checks if the user has the rights to view/request the data according to the claims in the JWT) -> API Handler (decoding user

Re: [go-nuts] JWT validation only in Middleware

2019-09-26 Thread burak serdar
On Thu, Sep 26, 2019 at 1:14 PM Martin Palma wrote: > > Hello, > > I'm in the process of writing an HTTP API with Go. I use a middleware for > generating and validating JWT tokens. On any incoming request the middleware > checks the JWT and validates it. If valid it adds it to the request header