{"id":15103245,"url":"https://github.com/raphael-97/quarkus-jwt","last_synced_at":"2026-01-06T16:04:54.132Z","repository":{"id":241840809,"uuid":"806026281","full_name":"raphael-97/quarkus-jwt","owner":"raphael-97","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-30T08:04:49.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T17:17:23.796Z","etag":null,"topics":["basic-authentication","docker","docker-compose","jwt","jwt-authentication","jwt-token","postgresql","quarkus","quarkus-hibernate-orm","quarkus-panache","quarkus-rest","rbac","role-based-access-control"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raphael-97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-26T06:48:56.000Z","updated_at":"2024-06-01T14:28:02.000Z","dependencies_parsed_at":"2024-05-30T09:31:53.969Z","dependency_job_id":"fec8a25d-853a-4bbd-a160-685b7a5de891","html_url":"https://github.com/raphael-97/quarkus-jwt","commit_stats":null,"previous_names":["raphael-97/quarkus-jwt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphael-97%2Fquarkus-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphael-97%2Fquarkus-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphael-97%2Fquarkus-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphael-97%2Fquarkus-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphael-97","download_url":"https://codeload.github.com/raphael-97/quarkus-jwt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245699262,"owners_count":20657987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic-authentication","docker","docker-compose","jwt","jwt-authentication","jwt-token","postgresql","quarkus","quarkus-hibernate-orm","quarkus-panache","quarkus-rest","rbac","role-based-access-control"],"created_at":"2024-09-25T19:22:42.694Z","updated_at":"2026-01-06T16:04:54.073Z","avatar_url":"https://github.com/raphael-97.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quarkus-jwt\n\n## Getting started\n1. Clone the project\n```\ngit clone https://github.com/raphael-97/Quarkus-jwt.git\n```\n\n2. Run in the root of this project\n```\nmvnw compile quarkus:dev\n\nor \n\ndocker compose up\n```\n\n\n### Endpoints with role based access control (RBAC)\n\nRoles: admin, user\n\n#### Auth\n\n`POST /api/auth/login` # Basic Authentication -\u003e You get jwt cookie after successful login\n\n`POST /api/auth/register` # All\n\n#### User (only accessible with bearer jwt token and the correct role)\n\nJwt token expires in 60 minutes if not changed in [application.properties](https://github.com/raphael-97/Quarkus-jwt/blob/main/src/main/resources/application.properties)\n\n`GET /api/users` # admin, user\n\n`GET /api/users/{id}`# admin, user\n\n`POST /api/users` # admin\n\n`PUT /api/users/{id}` # admin\n\n`DELETE /api/users/{id}` # admin\n\n\n### How to use\n\n#### Create an account (it has user role)\n\n```curl -i -X 'POST' 'http://localhost:8080/api/auth/register' -H 'Content-Type: application/json' -d '{ \"username\": \"john\", \"password\": \"secret\"}'```\n\n#### Login to your account\n\n\"am9objpzZWNyZXQ=\" is Base64 encoded String of username:password\n\n```curl -i -X POST 'http://localhost:8080/api/auth/login' -H 'Authorization: Basic am9objpzZWNyZXQ='```\n\nYou get a bearer jwt token back\n\n#### Use User api endpoint with jwt token\n\n```curl -i -X GET 'http://localhost:8080/api/users' -H 'Authorization: Bearer TOKENHERE'```\n\nKeep in mind your registered user only has access to endpoints with the user role\n\n\n#### Login to an admin account\n\nOne pre-made admin account has the username: \"admin\" and password: \"password\"\n\nThe Base64 encoded string is: YWRtaW46cGFzc3dvcmQ=\n\n\n\n#### Get the jwt token of admin role\n```curl -i -X POST 'http://localhost:8080/api/auth/login' -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ='```\n\n#### Create new account with the admin role and insert your jwt token\n\n```curl -i -X POST 'http://localhost:8080/api/users' -H 'Content-Type: application/json' -H 'Authorization: Bearer TOKENHERE' -d '{ \"username\": \"Doe\", \"password\": \"secret\", \"roles\": [\"admin\", \"user\"]}'```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphael-97%2Fquarkus-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphael-97%2Fquarkus-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphael-97%2Fquarkus-jwt/lists"}