Java authentication and authorization with JwtToken example using Maven, Jersey, Hibernate and H2
First you need to have Maven installed then import the project as Maven project
Request:
{
"name":"Test",
"email":"test@example.com",
"password":"1234"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YTBlYTJjZmIwNzc0ODIwNjA0MjZmMDUiLCJpYXQiOjE1MTA5MDg2MjMsImV4cCI6MTUxMDk5NTAyM30.X5XDB6_m1R9P87ErslknRs1qP6gVV815HyPLPRrKP8s"
}
Request:
{
"email":"test@example.com",
"password":"1234"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YTBlYTJjZmIwNzc0ODIwNjA0MjZmMDUiLCJpYXQiOjE1MTA5MDg2MjMsImV4cCI6MTUxMDk5NTAyM30.X5XDB6_m1R9P87ErslknRs1qP6gVV815HyPLPRrKP8s"
}
Request:
Header:
authorization: <token>
Response:
{
"id": 1,
"name": "Test",
"email": "test@example.com"
}
- Petar Petrov - Initial work - Petrakus
See also the list of contributors who participated in this project.