Skip to content

Commit 51c4c7d

Browse files
author
Daenges
committed
Add manual for token stuff
1 parent 9350e85 commit 51c4c7d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

realms/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# How to setup a new Keycloak instance
2+
*summary of [this Tutorial](https://medium.com/@nishada/keycloak-spring-boot-rbac-e8732a91909a)*
3+
4+
1. Create Realm
5+
2. Ressource file: `sb-backend.json` (may take a minute or two)
6+
3. Users → Add User → **fill all fields** (Username, Email, First name, Last name) otherwise there will be an error → Create
7+
4. Users → Click on User → Credentials → Set password → **NOT TEMPORARY**
8+
5. Users → Click on User → Role mapping → Add Admin / Student role
9+
10+
# How to request a JWT Token using Postman
11+
1. Create Post Request to `http://localhost:7070/realms/study-buddies/protocol/openid-connect/token`
12+
2. Set `Body` → `x-www-form-urlencoded`:
13+
14+
|Key|Value|
15+
|:-:|:-:|
16+
|client_id|sb-backend|
17+
|client_secret|Keycloak → Clients → sb-backend → Credentials|
18+
|grant_type|password|
19+
|username|User created above|
20+
|password|Password of user created above|
21+
22+
3. *Optional:* View content of `access_token` [here](https://jwt.io/).
23+
24+
# How to use a restricted endpoint using Postman
25+
1. Create Request
26+
2. Authorization &rarrr; Auth Type: Bearer Token → paste full content of `access_token` from JWT request above into `Token` field.
27+

0 commit comments

Comments
 (0)