{"id":26179287,"url":"https://github.com/bezkoder/spring-boot-refresh-token-jwt","last_synced_at":"2025-04-07T06:04:40.768Z","repository":{"id":38372972,"uuid":"359982148","full_name":"bezkoder/spring-boot-refresh-token-jwt","owner":"bezkoder","description":"Spring Boot Refresh Token using JWT example - Expire and Renew JWT Token","archived":false,"fork":false,"pushed_at":"2024-02-15T17:10:01.000Z","size":149,"stargazers_count":269,"open_issues_count":4,"forks_count":137,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T05:02:22.796Z","etag":null,"topics":["jwt","jwt-auth","jwt-authentication","jwt-authorization","spring-boot","spring-boot-2","spring-boot-security","spring-data","spring-security"],"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/bezkoder.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}},"created_at":"2021-04-21T00:00:33.000Z","updated_at":"2025-03-25T13:46:29.000Z","dependencies_parsed_at":"2023-01-24T03:16:15.812Z","dependency_job_id":null,"html_url":"https://github.com/bezkoder/spring-boot-refresh-token-jwt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fspring-boot-refresh-token-jwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fspring-boot-refresh-token-jwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fspring-boot-refresh-token-jwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezkoder%2Fspring-boot-refresh-token-jwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bezkoder","download_url":"https://codeload.github.com/bezkoder/spring-boot-refresh-token-jwt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"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","jwt-auth","jwt-authentication","jwt-authorization","spring-boot","spring-boot-2","spring-boot-security","spring-data","spring-security"],"created_at":"2025-03-11T21:49:29.251Z","updated_at":"2025-04-07T06:04:40.744Z","avatar_url":"https://github.com/bezkoder.png","language":"Java","readme":"# Spring Boot Refresh Token with JWT example\n\nBuild JWT Refresh Token in the Java Spring Boot Application. You can know how to expire the JWT, then renew the Access Token with Refresh Token.\n\nThe instruction can be found at:\n[Spring Boot Refresh Token with JWT example](https://bezkoder.com/spring-boot-refresh-token-jwt/)\n\n## User Registration, User Login and Authorization process.\nThe diagram shows flow of how we implement User Registration, User Login and Authorization process.\n\n![spring-boot-spring-security-jwt-authentication-flow](spring-boot-spring-security-jwt-authentication-flow.png)\n\nAnd this is for Refresh Token:\n\n![spring-boot-refresh-token-jwt-example-flow](spring-boot-refresh-token-jwt-example-flow.png)\n\n## Spring Boot Server Architecture with Spring Security\nYou can have an overview of our Spring Boot Server with the diagram below:\n\n![spring-boot-jwt-authentication-spring-security-architecture](spring-boot-jwt-authentication-spring-security-architecture.png)\n\n## Configure Spring Datasource, JPA, App properties\nOpen `src/main/resources/application.properties`\n\n```properties\nspring.datasource.url= jdbc:mysql://localhost:3306/testdb?useSSL=false\nspring.datasource.username= root\nspring.datasource.password= 123456\n\nspring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL5InnoDBDialect\nspring.jpa.hibernate.ddl-auto= update\n\n# App Properties\nbezkoder.app.jwtSecret= bezKoderSecretKey\nbezkoder.app.jwtExpirationMs= 3600000\nbezkoder.app.jwtRefreshExpirationMs= 86400000\n```\n\n## Run Spring Boot application\n```\nmvn spring-boot:run\n```\n\n## Run following SQL insert statements\n```\nINSERT INTO roles(name) VALUES('ROLE_USER');\nINSERT INTO roles(name) VALUES('ROLE_MODERATOR');\nINSERT INTO roles(name) VALUES('ROLE_ADMIN');\n```\n\nRelated Posts:\n\u003e [Spring Boot JWT Refresh Token using HttpOnly Cookies](https://www.bezkoder.com/spring-security-refresh-token/)\n\n\u003e [Spring Boot, Spring Security, MySQL: JWT Authentication \u0026 Authorization example](https://bezkoder.com/spring-boot-jwt-authentication/)\n\n\u003e [For PostgreSQL](https://bezkoder.com/spring-boot-security-postgresql-jwt-authentication/)\n\n\u003e [For MongoDB](https://bezkoder.com/spring-boot-jwt-auth-mongodb/)\n\n## More Practice:\n\u003e [Spring Boot File upload example with Multipart File](https://bezkoder.com/spring-boot-file-upload/)\n\n\u003e [Exception handling: @RestControllerAdvice example in Spring Boot](https://bezkoder.com/spring-boot-restcontrolleradvice/)\n\n\u003e [Spring Boot Repository Unit Test with @DataJpaTest](https://bezkoder.com/spring-boot-unit-test-jpa-repo-datajpatest/)\n\n\u003e [Spring Boot Pagination \u0026 Sorting example](https://www.bezkoder.com/spring-boot-pagination-sorting-example/)\n\nAssociations:\n\u003e [Spring Boot One To Many example with Spring JPA, Hibernate](https://www.bezkoder.com/jpa-one-to-many/)\n\n\u003e [Spring Boot Many To Many example with Spring JPA, Hibernate](https://www.bezkoder.com/jpa-many-to-many/)\n\n\u003e [JPA One To One example with Spring Boot](https://www.bezkoder.com/jpa-one-to-one/)\n\nDeployment:\n\u003e [Deploy Spring Boot App on AWS – Elastic Beanstalk](https://www.bezkoder.com/deploy-spring-boot-aws-eb/)\n\n\u003e [Docker Compose Spring Boot and MySQL example](https://www.bezkoder.com/docker-compose-spring-boot-mysql/)\n\n## Fullstack Authentication\n\n\u003e [Spring Boot + Vue.js JWT Authentication](https://bezkoder.com/spring-boot-vue-js-authentication-jwt-spring-security/)\n\n\u003e [Spring Boot + Angular 8 JWT Authentication](https://bezkoder.com/angular-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 10 JWT Authentication](https://bezkoder.com/angular-10-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 11 JWT Authentication](https://bezkoder.com/angular-11-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 12 JWT Authentication](https://www.bezkoder.com/angular-12-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 13 JWT Authentication](https://www.bezkoder.com/angular-13-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 14 JWT Authentication](https://www.bezkoder.com/angular-14-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 15 JWT Authentication](https://www.bezkoder.com/angular-15-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 16 JWT Authentication](https://www.bezkoder.com/angular-16-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + Angular 17 JWT Authentication](https://www.bezkoder.com/angular-17-spring-boot-jwt-auth/)\n\n\u003e [Spring Boot + React JWT Authentication](https://bezkoder.com/spring-boot-react-jwt-auth/)\n\n## Fullstack CRUD App\n\n\u003e [Vue.js + Spring Boot + H2 Embedded database example](https://www.bezkoder.com/spring-boot-vue-js-crud-example/)\n\n\u003e [Vue.js + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-vue-js-mysql/)\n\n\u003e [Vue.js + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-vue-js-postgresql/)\n\n\u003e [Angular 8 + Spring Boot + Embedded database example](https://www.bezkoder.com/angular-spring-boot-crud/)\n\n\u003e [Angular 8 + Spring Boot + MySQL example](https://bezkoder.com/angular-spring-boot-crud/)\n\n\u003e [Angular 8 + Spring Boot + PostgreSQL example](https://bezkoder.com/angular-spring-boot-postgresql/)\n\n\u003e [Angular 10 + Spring Boot + MySQL example](https://bezkoder.com/angular-10-spring-boot-crud/)\n\n\u003e [Angular 10 + Spring Boot + PostgreSQL example](https://bezkoder.com/angular-10-spring-boot-postgresql/)\n\n\u003e [Angular 11 + Spring Boot + MySQL example](https://bezkoder.com/angular-11-spring-boot-crud/)\n\n\u003e [Angular 11 + Spring Boot + PostgreSQL example](https://bezkoder.com/angular-11-spring-boot-postgresql/)\n\n\u003e [Angular 12 + Spring Boot + Embedded database example](https://www.bezkoder.com/angular-12-spring-boot-crud/)\n\n\u003e [Angular 12 + Spring Boot + MySQL example](https://www.bezkoder.com/angular-12-spring-boot-mysql/)\n\n\u003e [Angular 12 + Spring Boot + PostgreSQL example](https://www.bezkoder.com/angular-12-spring-boot-postgresql/)\n\n\u003e [Angular 13 + Spring Boot + H2 Embedded Database example](https://www.bezkoder.com/spring-boot-angular-13-crud/)\n\n\u003e [Angular 13 + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-angular-13-mysql/)\n\n\u003e [Angular 13 + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-angular-13-postgresql/)\n\n\u003e [Angular 14 + Spring Boot + H2 Embedded Database example](https://www.bezkoder.com/spring-boot-angular-14-crud/)\n\n\u003e [Angular 14 + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-angular-14-mysql/)\n\n\u003e [Angular 14 + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-angular-14-postgresql/)\n\n\u003e [Angular 15 + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-angular-15-mysql/)\n\n\u003e [Angular 15 + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-angular-15-postgresql/)\n\n\u003e [Angular 15 + Spring Boot + MongoDB example](https://www.bezkoder.com/spring-boot-angular-15-mongodb/)\n\n\u003e [Angular 16 + Spring Boot + H2 Embedded Database example](https://www.bezkoder.com/spring-boot-angular-16-crud/)\n\n\u003e [Angular 16 + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-angular-16-mysql/)\n\n\u003e [Angular 16 + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-angular-16-postgresql/)\n\n\u003e [Angular 16 + Spring Boot + MongoDB example](https://www.bezkoder.com/spring-boot-angular-16-mongodb/)\n\n\u003e [Angular 17 + Spring Boot + H2 Embedded Database example](https://www.bezkoder.com/spring-boot-angular-17-crud/)\n\n\u003e [Angular 17 + Spring Boot + MySQL example](https://www.bezkoder.com/spring-boot-angular-17-mysql/)\n\n\u003e [Angular 17 + Spring Boot + PostgreSQL example](https://www.bezkoder.com/spring-boot-angular-17-postgresql/)\n\n\u003e [Angular 17 + Spring Boot + MongoDB example](https://www.bezkoder.com/spring-boot-angular-17-mongodb/)\n\n\u003e [React + Spring Boot + MySQL example](https://bezkoder.com/react-spring-boot-crud/)\n\n\u003e [React + Spring Boot + PostgreSQL example](https://bezkoder.com/spring-boot-react-postgresql/)\n\n\u003e [React + Spring Boot + MongoDB example](https://bezkoder.com/react-spring-boot-mongodb/)\n\nRun both Back-end \u0026 Front-end in one place:\n\u003e [Integrate Angular with Spring Boot Rest API](https://bezkoder.com/integrate-angular-spring-boot/)\n\n\u003e [Integrate React.js with Spring Boot Rest API](https://bezkoder.com/integrate-reactjs-spring-boot/)\n\n\u003e [Integrate Vue.js with Spring Boot Rest API](https://bezkoder.com/integrate-vue-spring-boot/)\n\n## More Practice:\n\u003e [Spring Boot File upload example with Multipart File](https://bezkoder.com/spring-boot-file-upload/)\n\n\u003e [Exception handling: @RestControllerAdvice example in Spring Boot](https://bezkoder.com/spring-boot-restcontrolleradvice/)\n\n\u003e [Spring Boot Repository Unit Test with @DataJpaTest](https://bezkoder.com/spring-boot-unit-test-jpa-repo-datajpatest/)\n\n\u003e [Spring Boot Pagination \u0026 Sorting example](https://www.bezkoder.com/spring-boot-pagination-sorting-example/)\n\nAssociations:\n\u003e [JPA/Hibernate One To Many example](https://www.bezkoder.com/jpa-one-to-many/)\n\n\u003e [JPA/Hibernate Many To Many example](https://www.bezkoder.com/jpa-many-to-many/)\n\n\u003e [JPA/Hibernate One To One example](https://www.bezkoder.com/jpa-one-to-one/)\n\nDeployment:\n\u003e [Deploy Spring Boot App on AWS – Elastic Beanstalk](https://www.bezkoder.com/deploy-spring-boot-aws-eb/)\n\n\u003e [Docker Compose Spring Boot and MySQL example](https://www.bezkoder.com/docker-compose-spring-boot-mysql/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezkoder%2Fspring-boot-refresh-token-jwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbezkoder%2Fspring-boot-refresh-token-jwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezkoder%2Fspring-boot-refresh-token-jwt/lists"}