This Repository is used for references in the sector of JWT Security.
- Java version - 17
- Spring Boot Packages
- Maven 3.6 or higher.
- Sql Workbench
- Spring Boot Starters
- JSON Web Token
- Spring Security
- Spring Configuration Processor
- Spring Boot Test
-
Clone the Repository
git clone https://github.com/lgsurith/spring-auth-ref.git cd spring-auth-ref
-
Configure MySql Database in
application.properties
spring.application.name=authapi spring.datasource.url = jdbc:mysql://localhost:3306/employee_auth spring.datasource.username = username spring.datasource.password= password spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
-
Build the Project
mvn clean install
-
Run the Springboot Application
mvn spring-boot:run
The Application will start in
http://localhost:8080
Endpoint | Description |
---|---|
/api/auth/signup |
Initial user signup without authentication. |
/api/auth/login |
Obtain the token while logging in, which will be used for authentication by passing it in the bearer token. |
/api/user/me |
Gets the particular user's information after authentication. |
/api/user/ |
Gets all the users from the database. |