keyCloak: http://localhost:8080
admin login:
username: admin password: admin
need some configuration:
- First need to create realm.
- To call admin rest api, use admin-cli client. enable "Client authentication" and "Service accounts roles"
- Assign realm-admin role to admin-cli
- Use mailhog to send email
- Install mailhog. http://localhost:8025/
- Update email configuration from Realm Settings
- Host=localhost, port=1025, From=test@gmail.com, From display name=Keycloak Admin, Reply to=test@gmail.com, Reply to display name=Keycloak Admin
- Test connection and then save
http://localhost:8765/authentication/token/generate POST { "username":"test-001", "password": "123" }
http://localhost:8765/authentication/token/logout POST { "refreshToken":"${refreshToken}" }
http://localhost:8765/authentication/employee/save Authorization: Bearer ${token} POST { "username":"sunny", "name":"Mahua Majid Sunny", "gender":"Female", "phone_number":"1010101010", "birthdate":"01/01/2020", "address":"Dhaka", "given_name":"Mahua", "middle_name":"Majid", "family_name":"Talukder", "nickname":"Sunny", "password":"345", "email":"mahuasunny@gmail.com", "enabled":true }
http://localhost:8765/authentication/employee/list Authorization: Bearer ${token} GET
http://localhost:8765/authentication/role/save Authorization: Bearer ${token} POST { "name":"role1" }
http://localhost:8765/authentication/role/assign-role Authorization: Bearer ${token} POST { "userId":"bee810f6-fa31-4266-8f2b-8122f470164f", "roleName":"role1" }
http://localhost:8765/authentication/group/save Authorization: Bearer ${token} POST { "name":"group1" }
http://localhost:8765/authentication/group/save Authorization: Bearer ${token} POST { "name":"group1" }
http://localhost:8765/authentication/group/assign-role-group Authorization: Bearer ${token} POST { "groupId":"dbc656ae-b059-47c6-b45e-c82bce8738b8", "roleNameList":["role1","role2"] }
http://localhost:8765/authentication/group/assign-user-group Authorization: Bearer ${token} POST { "groupId":"dbc656ae-b059-47c6-b45e-c82bce8738b8", "userId":"bee810f6-fa31-4266-8f2b-8122f470164f" }
http://localhost:9004/authentication/employee/update-password Authorization: Bearer ${token} PUT
http://localhost:8765/currency-exchange/exchange-rate/from/USD/to/BDT Authorization: Bearer ${token} GET
http://localhost:8765/currency-conversion/conversion/from/USD/to/BDT/quantity/2 Authorization: Bearer ${token} GET