Skip to content

how to use jwt into spring cloud zuul with spring security.

Notifications You must be signed in to change notification settings

windseeker2011/jwt-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jwt-demo

how to use jwt into spring cloud zuul with spring security.

1.get token

curl -i -H "Content-Type: application/json" -X POST -d '{"username":"admin","password":"admin"}' http://localhost:8080/auth/login

curl -i -H "Content-Type: application/json" -X POST -d '{"username":"user","password":"user"}' http://localhost:8080/auth/login

2.use token

with token curl -i -H "Authorization: Bearer {u_get_token}" http://localhost:8080/service/user or without token curl -i http://localhost:8080/service/user

3.result

/service/admin /service/user /service/guest
admin token (role USER ADMIN) 200 200 200
user token (role USER) 403 200 200
no token 401 401 200

About

how to use jwt into spring cloud zuul with spring security.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages