Skip to content

barrrettt/springjwt-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springjwt-base

Base proyect for spring jwt api. Exe JAR or gradle bootrun and consume API:

Authenticate:

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

Get resources: (change "xxx.yyy.zzz" for token jwt)

curl -H "Authorization: Bearer xxx.yyy.zzz" http://localhost:8080/saludo

Admin actions

New user:

curl -i -H "Content-Type: application/json" -H "Authorization: Bearer xxx.yyy.zzz" -X POST -d '{"name": "newuser","password":"$2y$12$b69LWwDuQ7kARZQy9Hfpne938ArU6WHsZau9CEFnaVGUqX1oz0VBa","active":true,"roles":"ROLE_USER"}' http://localhost:8080/users

Delete user:

curl -i -H "Content-Type: application/json" -H "Authorization: Bearer xxx.yyy.zzz" -X DELETE  http://localhost:8080/users/newuser

Get one or all users:

curl -i -H "Content-Type: application/json" -H "Authorization: Bearer xxx.yyy.zzz" -X GET  http://localhost:8080/users/newuser
curl -i -H "Content-Type: application/json" -H "Authorization: Bearer xxx.yyy.zzz" -X GET  http://localhost:8080/users

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Additional Links

These additional references should also help you:

About

Base proyect for spring jwt api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages