Comments (6)
@axdg Can you please look at it?
from echox.
Sure; @transtone, I'm not able to replicate the problem - do you think that you could provide a snippet of your terminal IO so that I can figure out what's happening.
from echox.
this is what I do, and all my system(linux/windows) got the same problem:
# go get github.com/labstack/echo
# go get github.com/dgrijalva/jwt-go
# git clone https://github.com/labstack/echox.git
# cd echox/recipe/jwt-authentication
# go run main.go
# curl localhost:1323/restricted -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NTgwOTY1NjAsInVzZXJOYW1lIjoidHJhbnN0b25lIn0.2S-cvb_0TwCeWbX6weP9yhXgb3n2Ck_hbTfUEIKwzOw"
it gets nothing.
what's wrong with these steps?
curl -D - localhost:1323/restricted -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0NTgwOTY1NjAsInVzZXJOYW1lIjoidHJhbnN0b25lIn0.2S-cvb_0TwCeWbX6weP9yhXgb3n2Ck_hbTfUEIKwzOw"
it get:
HTTP/1.1 200 OK
Vary: Accept-Encoding
Vary: Origin
Date: Sun, 13 Mar 2016 03:25:17 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
when comment the JWTAuth line, it get:
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Vary: Accept-Encoding
Vary: Origin
Date: Sun, 13 Mar 2016 03:30:19 GMT
Content-Length: 25
Access granted with JWT.
from echox.
+1
from echox.
it seems the JWTAuth func have a problem:
https://github.com/labstack/echox/blob/master/recipe/jwt-authentication/main.go#L40
if err == nil && t.Valid {
// Store token claims in echo.Context
c.Set("claims", t.Claims)
return nil
}
it should be return next.Handle(c)
not return nil
from echox.
@transtone Looks like it did not upgrade properly to v2. I will fix it.
from echox.
Related Issues (20)
- Unknow Type when binding slice of struct in formdata request
- Document how to bind multiple instances of the same query param to a slice HOT 1
- Go-Validation example crashes server when issuing correct data HOT 3
- Websocket Example: Error for checkOrigin
- https://github.com/labstack/echox/pull/184
- Documentation Website is down? HOT 2
- get multiple checkbox HOT 2
- There are typos in the code in the template guide HOT 2
- Add note that echo.Context must not accessed out of coroutine handling that request HOT 1
- time.Time in json format
- Add a description of request logger to the documentation HOT 1
- [suggestion] Will not echo support Japanese Document?
- docs: HAHAHUGOSHORTCODE link? HOT 2
- docs: Remove incorrect note about registration of middleware
- Improve CORS middleware page HOT 2
- Need guidance on using echoprometheus.NewMiddleware for metrics server setup HOT 3
- Missing Middleware Package Import in Echo v4 Documentation
- Link not working HOT 1
- Documentation Code Blocks Copy `$`
- Invalid input in RateLimiter middleware in docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echox.