Skip to content

omarhosny206/user-authentication-and-authorization-service

Repository files navigation

User Authentication and Authorization Service 🚀

Service Functionality 🧠

  • Login and Signup services.
  • Each user has a specific role either ROLE_ADMIN or ROLE_CUSTOMER
  • Username and Password based Authentication.
  • Role based Authorization.
  • Used JWT(Json Web Token) for Authentication & Authorization.

Start using it now 🚀🚀

You can see the API documentation through: link

├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
    ├── main
    │   ├── java
    │   │   └── com
    │   │       └── example
    │   │           ├── config
    │   │           │   ├── BeanConfig.java
    │   │           │   └── SecurityConfig.java
    │   │           ├── controller
    │   │           │   ├── LoginController.java
    │   │           │   ├── SignupController.java
    │   │           │   └── UserController.java
    │   │           ├── dto
    │   │           │   ├── CustomUser.java
    │   │           │   ├── ErrorDto.java
    │   │           │   ├── LoginRequest.java
    │   │           │   ├── LoginResponse.java
    │   │           │   ├── SignupRequest.java
    │   │           │   └── UserDto.java
    │   │           ├── exception
    │   │           │   ├── ApiError.java
    │   │           │   ├── CustomAuthenticationEntryPoint.java
    │   │           │   ├── CustomExceptionHandler.java
    │   │           │   └── CustomException.java
    │   │           ├── filter
    │   │           │   └── JwtAuthenticationFilter.java
    │   │           ├── model
    │   │           │   ├── Role.java
    │   │           │   └── User.java
    │   │           ├── repository
    │   │           │   ├── RoleRepository.java
    │   │           │   └── UserRepository.java
    │   │           ├── service
    │   │           │   ├── impl
    │   │           │   │   ├── LoginServiceImpl.java
    │   │           │   │   ├── RoleServiceImpl.java
    │   │           │   │   ├── SignupServiceImpl.java
    │   │           │   │   └── UserServiceImpl.java
    │   │           │   ├── LoginService.java
    │   │           │   ├── RoleService.java
    │   │           │   ├── SignupService.java
    │   │           │   └── UserService.java
    │   │           ├── UserAuthenticationAndAuthorizationServiceApplication.java
    │   │           └── util
    │   │               ├── AuthenticationUser.java
    │   │               └── JwtUtil.java
    │   └── resources
    │       └── application.properties

Database Design

db_design

Tech Stack

  • Programming Language: Java 17
  • Backend Framework: Spring Boot v3.0.1
  • ORM: Hibernate
  • Database Engine: PostgreSQL
  • API Documentation: Swagger via OpenApi 3.0
  • Build Tool: Maven
  • Logger: SLF4J

Java Spring Hibernate Postgres JWT Swagger Maven Postman

Features to add in the future 🚀

  • Adding OAuth 2.0.
  • Signup with Google, Facebook and other platforms.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published