All Projects → bezkoder → spring-boot-security-postgresql

bezkoder / spring-boot-security-postgresql

Licence: other
Spring Boot, Spring Security, PostgreSQL: JWT Authentication & Authorization example

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to spring-boot-security-postgresql

spring-boot-login-example
Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example
Stars: ✭ 50 (-23.08%)
Mutual labels:  authorization, spring-security, spring-data-jpa, jwt-authentication
TASK-Management-System
Spring Boot and Angular 7 web application for task management .
Stars: ✭ 34 (-47.69%)
Mutual labels:  spring-security, spring-data-jpa, jwt-authentication
Registration Login Spring Xml Maven Jsp Mysql
Registration and Login Example with Spring MVC, Spring Security, Spring Data JPA, XML Configuration, Maven, JSP, and MySQL.
Stars: ✭ 134 (+106.15%)
Mutual labels:  authorization, spring-security, spring-data-jpa
Registration Login Spring Hsql
Registration and Login Example with Spring Security, Spring Boot, Spring Data JPA, HSQL, JSP
Stars: ✭ 208 (+220%)
Mutual labels:  authorization, spring-security, spring-data-jpa
zainabed-spring-security-jwt
Authentication & Authorization module for standalone Spring Boot app or Spring Cloud applications
Stars: ✭ 24 (-63.08%)
Mutual labels:  spring-security, jwt-authentication
react-redux-jwt-auth
React Redux: Token Authentication example with JWT, React Router, Axios, Thunk Middleware
Stars: ✭ 86 (+32.31%)
Mutual labels:  authorization, jwt-authentication
spring-examples
Starter projects with Spring using Java and Kotlin. Contains modules that covers Security with JWT, Spring with Kotlin, Dependency injection simplified etc.
Stars: ✭ 33 (-49.23%)
Mutual labels:  spring-security, jwt-authentication
Spring5Certification
Spring Certification: This repository contains my examples and some best references to prepare the Spring 5 certification
Stars: ✭ 30 (-53.85%)
Mutual labels:  spring-security, spring-data-jpa
OnlineStore
REST api for an online store using microservices architecture.
Stars: ✭ 27 (-58.46%)
Mutual labels:  spring-security, spring-data-jpa
spring-boot-blueprint
Spring Boot blueprint with Keycloak and Vue.js
Stars: ✭ 36 (-44.62%)
Mutual labels:  spring-security, spring-data-jpa
secure-oauth2-oidc-workshop
Hands-On Workshop for OAuth 2.0 and OpenID Connect 1.0
Stars: ✭ 58 (-10.77%)
Mutual labels:  authorization, spring-security
spring-boot-shop-sample
My first web application using Spring Boot framework.
Stars: ✭ 66 (+1.54%)
Mutual labels:  spring-security, spring-data-jpa
react-jwt-auth
React JWT Authentication & Authorization example - React.js Login and Registration example
Stars: ✭ 307 (+372.31%)
Mutual labels:  authorization, jwt-authentication
springboot-vue.js-bbs
Spring Boot, Vue.js
Stars: ✭ 43 (-33.85%)
Mutual labels:  spring-security, spring-data-jpa
firebase-spring-boot-rest-api-authentication
Firebase Spring Boot Rest API Authentication
Stars: ✭ 172 (+164.62%)
Mutual labels:  authorization, spring-security
jersey-jwt-springsecurity
Example of REST API with JWT authentication using Spring Boot, Spring Security, Jersey and Jackson.
Stars: ✭ 44 (-32.31%)
Mutual labels:  spring-security, jwt-authentication
Spring
Personal notes of preparation to Spring 5 Professional Certification
Stars: ✭ 35 (-46.15%)
Mutual labels:  spring-security, spring-data-jpa
react-auth-kit
Easily manage Authentication state of users in React-based Apps using Hooks and Higher-order components
Stars: ✭ 177 (+172.31%)
Mutual labels:  authorization, jwt-authentication
spring-boot-refresh-token-jwt
Spring Boot Refresh Token using JWT example - Expire and Renew JWT Token
Stars: ✭ 156 (+140%)
Mutual labels:  spring-security, jwt-authentication
Diber-backend
Delivery Service - Spring Boot / Spring Data Jpa / Hibernate / PostgreSQL / OAuth2 Application
Stars: ✭ 22 (-66.15%)
Mutual labels:  spring-security, spring-data-jpa

Spring Boot, Spring Security, PostgreSQL: JWT Authentication & Authorization example

User Registration, User Login and Authorization process.

The diagram shows flow of how we implement User Registration, User Login and Authorization process.

spring-boot-spring-security-postgresql-jwt-authentication-flow

Spring Boot Server Architecture with Spring Security

You can have an overview of our Spring Boot Server with the diagram below:

spring-boot-spring-security-postgresql-jwt-authentication-architecture

For more detail, please visit:

Spring Boot, Spring Security, PostgreSQL: JWT Authentication & Authorization example

For MySQL

For MongoDB

Refresh Token

spring-boot-refresh-token-jwt-example-flow

For instruction: Spring Boot Refresh Token with JWT example

Fullstack Authentication

Spring Boot + Vue.js JWT Authentication

Spring Boot + Angular 8 JWT Authentication

Spring Boot + Angular 10 JWT Authentication

Spring Boot + Angular 11 JWT Authentication

Spring Boot + React JWT Authentication

Fullstack CRUD App

Vue.js + Spring Boot + MySQL/PostgreSQL example

Angular 8 + Spring Boot + MySQL example

Angular 8 + Spring Boot + PostgreSQL example

Angular 10 + Spring Boot + MySQL example

Angular 10 + Spring Boot + PostgreSQL example

Angular 11 + Spring Boot + MySQL example

Angular 11 + Spring Boot + PostgreSQL example

React + Spring Boot + MySQL example

React + Spring Boot + PostgreSQL example

Run both Back-end & Front-end in one place:

Integrate Angular with Spring Boot Rest API

Integrate React.js with Spring Boot Rest API

Integrate Vue.js with Spring Boot Rest API

More Practice:

Spring Boot File upload example with Multipart File

Exception handling: @RestControllerAdvice example in Spring Boot

Spring Boot Repository Unit Test with @DataJpaTest

Deploy Spring Boot App on AWS – Elastic Beanstalk

Secure Spring Boot App with Spring Security & JWT Authentication

Dependency

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
		
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-security</artifactId>
</dependency>
		
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
	<groupId>org.postgresql</groupId>
	<artifactId>postgresql</artifactId>
	<scope>runtime</scope>
</dependency>
		
<dependency>
	<groupId>io.jsonwebtoken</groupId>
	<artifactId>jjwt</artifactId>
	<version>0.9.1</version>
</dependency>

Configure Spring Datasource, JPA, App properties

Open src/main/resources/application.properties

spring.datasource.url= jdbc:postgresql://localhost:5432/testdb
spring.datasource.username= postgres
spring.datasource.password= 123

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation= true
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.PostgreSQLDialect

# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto= update

# App Properties
bezkoder.app.jwtSecret= bezKoderSecretKey
bezkoder.app.jwtExpirationMs= 86400000

Run Spring Boot application

mvn spring-boot:run

Run following SQL insert statements

INSERT INTO roles(name) VALUES('ROLE_USER');
INSERT INTO roles(name) VALUES('ROLE_MODERATOR');
INSERT INTO roles(name) VALUES('ROLE_ADMIN');
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].