Skip to content

Commit 0852b2c

Browse files
authored
Update README.md
1 parent c19c6dc commit 0852b2c

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
![authentication_system roles](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/a6e4647f-3106-47b4-a118-2682dfb565b7)
2-
3-
![authentication_system user_roles](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/ec1e89ff-ac89-4ed3-8954-fa7a0d1a1e6a)
4-
5-
![authentication_system users](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/a8424f77-9bbd-4ab7-9dc1-ca586708622d)
6-
71
# Java-backend-Spring-boot-MySQL-login-logout-Authentication-System
82
* Java Backend Spring Boot Authentication System is a comprehensive and secure authentication solution developed using the Spring Boot framework. This system integrates various essential components, including Spring Security, JWT (JSON Web Tokens), and MySQL, to establish a robust user authentication experience. It offers features such as user registration, login, role-based access control, and secure logout functionality.
93

@@ -136,10 +130,17 @@ Request Body:
136130
}
137131
click on ---> Send
138132
* Response: HTTP 200 OK with "User registered successfully" message.
133+
*
134+
![User_register](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/9f503ac4-834d-409e-ad7c-01bcd9c40558)
139135

140136
* Bad Credentials: If the provided username or email is already taken,
141137
the endpoint returns HTTP 400 Bad Request with an appropriate error message.
142138

139+
140+
![User_already](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/0f9feb76-23f0-49a8-b731-46c75834ed67)
141+
142+
143+
143144
* 2 User Login Endpoint:
144145
URL:
145146
* Method POST: http://localhost:8080/api/auth/login
@@ -153,29 +154,40 @@ Request Body:
153154

154155
* Response: HTTP 200 OK with a JWT token in the response body.
155156

157+
![login](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/c17d8308-a24b-4d27-af94-39571bd7d8df)
158+
156159
* JWT token (On successful login):
157160
{
158-
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huX2RvZSIsInJvbGUiOiJST0x
159-
FX1VTRVIiLCJpYXQiOjE2MjgxOTQ1OTUsImV4cCI6MTYyODE5ODM5NX0.kiZb0N6dO03t
160-
9pPmFgWkGTr5F76vE7w_z-ZrkaCLy2c"
161+
"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ3b3JvbWVkaWFfMUBleGFtcGxlLmNvb
162+
SIsImlhdCI6MTY5MTcwOTA0NywiZXhwIjoxNjkyMzEzODQ3fQ.d4GRTnppSYzlONRFleCqRbRgi7WsJe_fxv6Ui
163+
EOpfl9h5sr5FG5D3EQ9IdkKGNxZVKnNbKTU-hZi_bPtRMtafg",
164+
"tokenType": "Bearer"
165+
}
161166
}
162167

163168
* Bad Credentials: If the provided username or email and password combination is invalid, the endpoint returns HTTP 401 Unauthorized with an error message.
164169

170+
![wrong input password or username](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/139656f1-a667-4ad8-8817-49c04fbe48ae)
171+
165172
* 3 Admin Panel Endpoint:
166173

167174
URL:
168175
* Method GET : http://localhost:8080/api/auth/admin
176+
169177
* Select --> Authorization --> Bearer token --> copy login token paste in Token like below,
170-
Token: [ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqb2huX2RvZSIsInJvbGUiOiJST0x
171-
FX1VTRVIiLCJpYXQiOjE2MjgxOTQ1OTUsImV4cCI6MTYyODE5ODM5NX0.kiZb0N6dO03t9pPmFgWkGTr5F76vE7w_z-ZrkaCLy2c ]
178+
Token: [ eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ3b3JvbWVkaWFfMUBleGFtcGxlLmNvb
179+
SIsImlhdCI6MTY5MTcwOTA0NywiZXhwIjoxNjkyMzEzODQ3fQ.d4GRTnppSYzlONRFleCqRbRgi7WsJe_fxv6Ui
180+
EOpfl9h5sr5FG5D3EQ9IdkKGNxZVKnNbKTU-hZi_bPtRMtafg ]
172181

173182
Click on Send
174183
* Response: HTTP 200 OK with "Admin Panel" message.
175-
184+
185+
![Admin](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/0478778a-7aa7-4764-8553-7e0407ec3a2d)
186+
176187
* Authorization Error: If a user without the "ROLE_ADMIN" role tries to access
177188
this endpoint, the application returns HTTP 403 Forbidden with an error message.
178189

190+
![wrong input jwt token](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/125a8442-8b90-4119-a480-14fd02263f9f)
179191

180192
* User Logout Endpoint:
181193

@@ -184,6 +196,17 @@ URL:
184196
* Click on Send
185197
* Response: HTTP 200 OK with "Logged out successfully" message
186198

199+
![logout](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/a4f51992-80b1-4c83-bce4-a4e83642e79b)
200+
201+
# Easily Collect User Registration Data with Postman, Keep it Safe in a MySQL Database, and Improve the User Signup Process.
202+
203+
![authentication_system roles](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/a6e4647f-3106-47b4-a118-2682dfb565b7)
204+
205+
![authentication_system user_roles](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/ec1e89ff-ac89-4ed3-8954-fa7a0d1a1e6a)
206+
207+
![authentication_system users](https://github.com/SDEParag/Java-backend-Spring-boot-MySQL-login-logout-Authentication-System/assets/137553676/a8424f77-9bbd-4ab7-9dc1-ca586708622d)
208+
209+
187210
# Handling Bad Credentials
188211
* If the provided username or email during registration is already taken, the application returns HTTP 400 Bad Request with an appropriate error message.
189212

0 commit comments

Comments
 (0)