Code Monkey home page Code Monkey logo

juancarlosaguilarb / apigateway-with-auth-server-spring-boot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 95 KB

This project demonstrates how to set up an API Gateway with an Authentication Server using JWT (JSON Web Tokens) authentication. It utilizes Spring Boot along with Eureka Server for service discovery and Config Server for centralized configuration management.

Java 100.00%
api-gateway auth-server config-server eureka-discovery-service microservice spring-boot

apigateway-with-auth-server-spring-boot's Introduction

Spring Boot API Gateway with Auth Server and JWT Example

This project demonstrates how to set up an API Gateway with an Authentication Server using JWT (JSON Web Tokens) authentication. It utilizes Spring Boot along with Eureka Server for service discovery and Config Server for centralized configuration management.

Overview

This project serves as an example of implementing an API Gateway to manage authentication and routing for microservices in a Spring Boot environment. It showcases the following components:

  • API Gateway: Centralized entry point for handling requests, routing them to the appropriate microservices, and managing authentication using JWT.
  • Authentication Server: Provides authentication and issues JWT tokens to users.
  • Eureka Server: Service registry for service discovery.
  • Config Server: Centralized configuration management for microservices.

Prerequisites

Before running this project, ensure you have the following installed:

  • Java Development Kit (JDK) 17 or higher
  • Gradle
  • Docker (optional, for running Eureka Server and Config Server in containers)

Installation

  1. Clone this repository:

    git clone https://github.com/JuanCarlosAguilarB/apigateway-with-auth-server-spring-boot.git
  2. Build the project:

    cd spring-boot-api-gateway-example
  3. Run Eureka Server and Config Server (if not using Docker):

    # Assuming you have Docker installed
    docker-compose up -d

Usage

  1. Access the Eureka Server dashboard to ensure all microservices are registered:

    http://localhost:8761/
    
  2. Obtain JWT tokens from the Authentication Server:

    POST http://localhost:8081/login/v1/
    

    Include the client credentials and user credentials in the request body. Refer to the Authentication Server documentation for details.

  3. Use the obtained JWT token to access protected resources via the API Gateway.

Contributing

Contributions are welcome! Please follow these guidelines when contributing to the project:

  • Fork the repository
  • Create a new branch for your feature or bug fix
  • Make your changes and test thoroughly
  • Submit a pull request to the develop branch

License

This project is licensed under the MIT License.

apigateway-with-auth-server-spring-boot's People

Contributors

juancarlosaguilarb avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.