Skip to content

This repository contains a collection of fixes for issues in the latest version of Spring Security.

Notifications You must be signed in to change notification settings

tamerlankayak/SpringSecurityJWT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpringSecurityJWT

Code working.Solved problem in new version.

Java_programming_language_logo svg spring-boot-logo

# Spring Security Project with JWT

This project demonstrates how to implement authentication and authorization using Spring Security with JSON Web Tokens (JWT) in a Spring Boot 3 application.

## Features

- User registration and login endpoints
- JWT generation and validation
- Secure API endpoints using JWT
- Role-based authorization

## Technologies Used

- Spring Boot 3
- Spring Security
- JSON Web Tokens (JWT)
- Maven

## Getting Started


### Prerequisites

- Java Development Kit (JDK) 11 or higher
- Maven

### Installation

1. Clone the repository:

   ```bash
   git clone https://github.com/tamerlankayak/SpringSecurityJWT.git
  1. Change to the project directory:

    cd spring-security-jwt
  2. Build the application:

    mvn clean install

Configuration

  1. Open the application.properties file located in the src/main/resources directory.

  2. Modify the database configuration properties according to your setup. For example:

    spring.datasource.url=jdbc:mysql://localhost:3306/mydatabase
    spring.datasource.username=db_user
    spring.datasource.password=db_password
    
  3. Save the changes.

Usage

  1. Run the application:

    mvn spring-boot:run
  2. The application will start on http://localhost:8080.

  3. Use a tool like Postman to interact with the API endpoints.

Note: To access the protected resource, include the JWT in the request header using the Authorization header with the value Bearer <JWT>, where <JWT> is the token obtained after successful authentication.

Contributing

Contributions are welcome! Please follow the steps below to contribute to this project:

  1. Fork the repository.
  2. Create a new branch: git checkout -b my-branch-name.
  3. Make your modifications and commit changes: git commit -am 'Add some feature'.
  4. Push to the branch: git push origin my-branch-name.
  5. Submit a pull request.

Make sure to update the placeholders such as `your-username` in the clone URL and customize other sections according to your project. Also, remember to include the appropriate license file (e.g., `LICENSE`) in your repository.

About

This repository contains a collection of fixes for issues in the latest version of Spring Security.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published