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
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
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