{"id":16192512,"url":"https://github.com/krinskumar/spring-security-jwt","last_synced_at":"2025-04-07T15:12:23.029Z","repository":{"id":190451173,"uuid":"682206440","full_name":"KrinsKumar/spring-security-JWT","owner":"KrinsKumar","description":"API security implemented on Spring Boot 🌱 using JWT","archived":false,"fork":false,"pushed_at":"2023-08-24T17:57:57.000Z","size":225,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T17:37:53.206Z","etag":null,"topics":["jwt","spring-security","springboot"],"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/KrinsKumar.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}},"created_at":"2023-08-23T17:11:08.000Z","updated_at":"2023-08-27T19:31:58.000Z","dependencies_parsed_at":"2023-08-24T19:17:51.288Z","dependency_job_id":null,"html_url":"https://github.com/KrinsKumar/spring-security-JWT","commit_stats":null,"previous_names":["krinskumar/spring-security-jwt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrinsKumar%2Fspring-security-JWT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrinsKumar%2Fspring-security-JWT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrinsKumar%2Fspring-security-JWT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrinsKumar%2Fspring-security-JWT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrinsKumar","download_url":"https://codeload.github.com/KrinsKumar/spring-security-JWT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675609,"owners_count":20977378,"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":["jwt","spring-security","springboot"],"created_at":"2024-10-10T08:10:21.953Z","updated_at":"2025-04-07T15:12:23.009Z","avatar_url":"https://github.com/KrinsKumar.png","language":"Java","readme":"# Spring Boot JWT Backend\nA Spring Boot backend application that utilizes JWT (JSON Web Tokens) for authentication and authorization.\n\n## Overview\nThis project provides a robust backend setup with JWT authentication. Users can register, authenticate, and make API calls secured with JWT. All of the users are saved on a local postgresql server.  \n\n![403](gh-images/diagram.png)\n\n### An API call to **localhost:8080/api/v1/demo** without JWT token:\n![403](gh-images/403.png)\n\n### An API call to **localhost:8080/api/v1/demo** with JWT token in the header:\n![200](gh-images/200.png)\n```\nAuthorization: bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJrcmluc0BlbWFpbC5jb20iLCJpYXQiOjE2OTI4OTY5OTMsImV4cCI6MTY5MzUwMTc5M30.Vuqr89siFnWeB3p4AO-epUtpODZ-PcCLjwlcqNOJ4Nw\n``````\n\n### To create a new account: Send a POST request to **localhost:8080/api/v1/register** with these in the body, and that will create an account and response with a token\n```json\n{\n  \"firstname\": \"krins\",\n  \"lastname\": \"krins\",\n  \"email\": \"krins@email.com\",\n  \"password\": \"password\"\n} \n``` \n![Token](gh-images/token.png)\n![postgres](gh-images/db.png)\n\n### if you are already registered and you need a new token, you can make a POST request to **localhost:8080/api/v1/authenticate** with email and password in the body, and that should return with a new JWT token.\n![Token](gh-images/token.png)\n\n### The payload of the jwt contains information about the email, expiration date and issue date\n```json\n{\n  \"sub\": \"krins@email.com\",\n  \"iat\": 1692896993,\n  \"exp\": 1693501793\n}\n``````","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrinskumar%2Fspring-security-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrinskumar%2Fspring-security-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrinskumar%2Fspring-security-jwt/lists"}