https://github.com/iifast2/springsecurity-api-jwt-pidev-roles
springsecurity-api-jwt-springboot-waf-with-roles
https://github.com/iifast2/springsecurity-api-jwt-pidev-roles
Last synced: 5 months ago
JSON representation
springsecurity-api-jwt-springboot-waf-with-roles
- Host: GitHub
- URL: https://github.com/iifast2/springsecurity-api-jwt-pidev-roles
- Owner: iifast2
- Created: 2022-03-02T20:43:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-01T16:01:21.000Z (over 1 year ago)
- Last Synced: 2024-11-11T14:44:23.893Z (7 months ago)
- Language: Java
- Size: 1.04 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe-Authentication-Jwt-roles.md
Awesome Lists containing this project
README
# POSTMAN :
📧 ✔️Will send an email each time the userSeeder creates the admins & mangers accounts
## Generate Bearer jwt Token - POST :
(will displat your JWT bearer token so you can access everything later on ):
```
http://localhost:8080/token
```
```
{
"username" : "admin",
"password" : "admin"
}
```
Will display the token for you :
**Jwt Token :**
```
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInNjb3BlcyI6IlJPTEVfQURNSU4iLCJpYXQiOjE2NDYyNDc4NDksImV4cCI6MTY0NjMzNDI0OX0.HcW59lXvv2-_R_pRer9QpsNvDZwv2kmOHcBHPHtO2KI
```________
## Authorization - GET :
(will use the jwt bearer token to get access to your admin / profile info)
Add / Paste your token to **Authorisation > Type > Bearer Token**
```
http://localhost:8080/auth
```This will display your admin info :
```
{
"id": 1,
"firstName": null,
"lastName": null,
"username": "admin",
"salary": 1150,
"birthdate": "1997/6/7",
"address": "address",
"leaveBalance": 30,
"rib": null,
"facebook": null,
"instagram": null,
"linkedin": null,
"cin": "0788888887",
"email": "[email protected]",
"notifications": [],
"roles": [
{
"id": 1,
"name": "ADMIN",
"description": "ADMIN"
}
],
"requests": []
}
```

________
## FindAll / FetchAll - GET :
( fetchall : this will display all the application users and thier infos )
```
http://localhost:8080/users
```add this to request body and _**add your jwt / bearer token**_ to the **authorization** :
```
{
"username" : "admin",
"password" : "admin"
}
```
________
## FetchByID / FindByID - GET :
(fetch user by id , don't forget to add your bearer token to the **Authorization** )```
http://localhost:8080/users/3
```
this will display the user with id : 3
```
{
"id": 3,
"firstName": null,
"lastName": null,
"username": "manager",
"salary": 1150,
"birthdate": "1999/6/7",
"address": "address",
"leaveBalance": 30,
"rib": null,
"facebook": null,
"instagram": null,
"linkedin": null,
"cin": "07887877",
"email": "[email protected]",
"notifications": [],
"roles": [
{
"id": 3,
"name": "MANAGER",
"description": "MANAGER"
}
],
"requests": []
}
```
________
## FindByUserName - GET :
( find by username : /users/username/{us} )```
http://localhost:8080/users/username/admin1
```
________
## Change Password - POST
1. **POST :**
**GET :**
2. ```
http://localhost:8080/token
http://localhost:8080/auth
```
(change password : /password )
**POST :**
```
http://localhost:8080/password
```
________
## Modify users - PUT
(modify : /users )```
http://localhost:8080/users
``````
{
"id": 4,
"firstName": null,
"lastName": null,
"username": "userr",
"birthdate": null,
"address": "rue esprit",
"email": "[email protected]",
"notifications": null,
"roles": ["ADMIN"]
}
```
## Add User - POST :
```
http://localhost:8080/users
``````
{
"username" : "user1",
"password" : "user",
"email": "[email protected]",
"roles": ["ADMIN"]
}
```
________
________
# QRCode Generator
## QrCode - GET :
( this will generate a QRCode for you + add the authorization jwt bearer token before you send HTTP Request ) :```
http://localhost:8080/genrateAndDownloadQRCode/SILVER_IMAGE_PATH/350/350
```
_____
_____```
```