Code Monkey home page Code Monkey logo

oauth-with-jwt-authorization's Introduction

OAuth2 Authentication with Spring Boot ๐Ÿš€

Hey there! Welcome to our OAuth2 authentication project built with Spring Boot. This readme will get you up to speed on what this project does and how you can use it.

What's This All About?

So, this project is basically a cool demo showing how we handle user authentication using OAuth2 and JWT tokens in a Spring Boot app. You know, stuff like registering users, logging them in, and generating those snazzy tokens.

How to Get Started

Prerequisites Before you dive in, make sure you have the following installed:

Java Development Kit (JDK) 8 or higher

Apache Maven MongoDB or another supported database (you'll need to configure this in application.properties) Postman or some other tool for testing APIs

Step 1: Clone the Project

  1. Open a terminal on your computer.

  2. Clone the project repository by running the following command:

    git clone [<repository-url>](https://github.com/iammahesh123/oAuth-with-jwt-authorization.git)
    cd JwtAuthorizationdemo
    
  3. Go to the Project Directory: Jump into the project folder

    mvn clean install
  4. Run the App: Start the Spring Boot magic:

    mvn spring-boot:run
    

How to Use It

Once the app is up and running, you can start playing around with it using some HTTP requests. Here's a quick rundown of the available endpoints:

POST /api/auth/register: Register a new user. Just send over a JSON with userName and password, and you'll get a JWT token in return!

POST /api/auth/login : Log in an existing user. Again, a JSON with userName and password will do the trick. You'll get a shiny new JWT token as a reward for logging in successfully.

POST /api/auth/token : Need to refresh your JWT token? No problemo! Send the old token as refreshToken in a JSON payload, and voilร ! You'll get a fresh one in return.

Contributing

We're totally open to contributions! Found a bug? Have an awesome idea for an improvement? Feel free to open an issue or send us a pull request. Let's make this project even better together!

License

This project is licensed under the MIT License. So go ahead, tweak it, share it, do whatever you want with it (just don't forget to credit us ๐Ÿ˜‰).

oauth-with-jwt-authorization's People

Contributors

iammahesh123 avatar

Stargazers

Ilham Mufid avatar  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.