Skip to content

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.

Notifications You must be signed in to change notification settings

iammahesh123/oAuth-with-jwt-authorization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 😉).

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages