Skip to content

rjozefowicz/sparkjava-jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sparkjava-jwt

Example SparkJava - JWT integration

tech

Public available endpoints

ENDPOINT HTTP METHOD PARAMS DESCRIPTION
/auth/register POST JSON body mandatory fields: userName, password. Additional fields firstName, secondName New user registration
/auth/login POST JSON body mandatory fields: userName, password User login

Additional JWT endpoints

HTTP Header: Authorization: Bearer JWTToken

ENDPOINT HTTP METHOD PARAMS DESCRIPTION
/auth/token POST JWT token refresh
/auth/logout POST JWT token revocation
/auth/me GET User details

Roles

Predefined user roles:

  • ADMIN
  • MANAGER
  • DEVELOPER

Endpoints for Role management:

ENDPOINT HTTP METHOD PARAMS DESCRIPTION
/auth/roles POST JSON body mandatory fields: userName, role Add new Role to user
/auth/roles DELETE JSON body mandatory fields: userName, role Revoke Role from User

Admin user

Predefined Admin user (admin/admin)

Additional

Cron job (every minute) to clean up revoked JWT Tokens

About

sparkjava-jwt - example SparkJava - JWT integration

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages