Advertisement
irobust

Kong JWT Plugin

Apr 23rd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. 1. Add JWT plugin
  2. curl -X POST http://localhost:8001/plugins
  3. --data="name=jwt"
  4.  
  5. 2. Add consumers
  6. curl -X POST http://localhost:8001/consumers
  7. --data="custom_id=abc1234"
  8.  
  9. 3. Generate Key
  10. curl -X POST http://localhost:8001/consumers/abc1234/jwt
  11.  
  12. 4. Get generated key and secret
  13. curl -X GET http://localhost:8001/consumers/abc1234/jwt
  14.  
  15. 5. Generate JWT Token (HS256)
  16. Set key to iss(claims)
  17. Set secret to signature
  18.  
  19. 6. Add apiKey header
  20. curl -X GET http://locahost:8000/api/v1/products
  21. --header="Authorization=Bearer <Get API JWT Token from previous step>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement