{"id":24562694,"url":"https://github.com/adudko/spring-security-with-jwt-in-action","last_synced_at":"2026-04-18T02:31:07.888Z","repository":{"id":272695295,"uuid":"917322589","full_name":"aDudko/spring-security-with-jwt-in-action","owner":"aDudko","description":"Example of Spring Security implementation with JWT","archived":false,"fork":false,"pushed_at":"2025-03-14T10:22:59.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T11:25:06.635Z","etag":null,"topics":["docker-image","example-project","jwt","postgres","rest-api","spring-security"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/anatolydudko/spring-security-with-jwt-in-action","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aDudko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-01-15T19:09:12.000Z","updated_at":"2025-03-14T10:23:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"5168a26c-bb5d-4735-bb7f-ba01856d21ad","html_url":"https://github.com/aDudko/spring-security-with-jwt-in-action","commit_stats":null,"previous_names":["adudko/spring-security-with-jwt-in-action"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aDudko/spring-security-with-jwt-in-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fspring-security-with-jwt-in-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fspring-security-with-jwt-in-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fspring-security-with-jwt-in-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fspring-security-with-jwt-in-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aDudko","download_url":"https://codeload.github.com/aDudko/spring-security-with-jwt-in-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aDudko%2Fspring-security-with-jwt-in-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker-image","example-project","jwt","postgres","rest-api","spring-security"],"created_at":"2025-01-23T09:17:05.395Z","updated_at":"2026-04-18T02:31:07.873Z","avatar_url":"https://github.com/aDudko.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Security with JWT in Action\n\n**Example of Spring Security implementation with JWT**\n\n## Overview\n\nThe application is designed as a microservice with no user interface.\n\nThe app provides 3 methods to `register`, `login` and `getProfile`. By default, every new user is registered with the\n`ROLE_USER` role. There is no function to change the role via API. When calling login and registration methods, the\nresponse will return an `accessToken`.\n\nIn the current implementation, the data is stored in a separate Postgres schema `accounts` that provides a materialized\nview `user_roles_m_view`. The schema contains 3 tables: `users`, `roles` and `user_roles`. By default the project\nsupports 4 starting roles: `ROLE_USER`, `ROLE_MANAGER`, `ROLE_ANALYTICS`, `ROLE_ADMIN`.\n\n[API documentation](http://localhost:8080/swagger-ui/index.html#/) will be available once the application is started\n\n## Technologies\n\n- `Java` - version `17`\n- `Maven` - for building the application\n- `Spring Boot` - version `3.2.5`\n- `JWT`\n- `OpenAPI` - API documentation\n- `Spring Boot Maven Plugin` - for create Docker-Image\n- `Docker-Compose` - infrastructure\n- `Postgres` - credential storage\n\n## Structure of the project\n\n```\nspring-security-with-jwt-in-action/\n├── src/main/\n|   ├── java/com/dudko/example\n|   |   ├── config/\n|   |   ├── controller/             # controllers\n|   |   ├── domain/                 # persistent domain level and repositories\n|   |   ├── model/                  # service level of the domain, used in business logic and controllers\n|   |   ├── security/               # security logic\n|   |   ├── service/                # business logic\n|   ├── resources/                  # configs, validation messages and schema for DB with initial scripts\n├── pom.xml                         # artifact of Maven\n├── compose.yml                     # docker-compose file\n├── postman_collection.json         # collection of requests for Postman\n```\n\n## How to try this project?\n\n❗Don't forget to set the `JWT_SECRET` environment variable before running the application (you know what to do).\nYou can use, for example, [this service](https://emn178.github.io/online-tools/sha256.html)\n\n```sh\ndocker-compose -f compose.yml up\n```\n\n### Author:\n\nAnatoly Dudko\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadudko%2Fspring-security-with-jwt-in-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadudko%2Fspring-security-with-jwt-in-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadudko%2Fspring-security-with-jwt-in-action/lists"}