StickerMap uses Keycloak for identity and access management.
Four hierarchical client roles (scoped to the stickermap-client client) with the sm- prefix:
| Role | Name | Permissions |
|---|---|---|
| Viewer | sm-viewer |
View all sticker details (default for all users) |
| Uploader | sm-uploader |
Upload new stickers and edit own stickers |
| Editor | sm-editor |
Edit any sticker's poster name, post date, and location |
| Administrator | sm-admin |
Full access: edit all fields and delete stickers |
Roles are implemented as Keycloak composite roles — each role includes the permissions of all roles below it:
sm-adminincludessm-editorsm-editorincludessm-uploadersm-uploaderincludessm-viewersm-vieweris assigned by default to all new users via the/stickermap/sm-viewersub-group (set as default group)
Assign only the highest needed role per user.
Import general/keycloak_realm/stickermap-realm.json via the Keycloak Admin Console. All roles and the stickermap-client client are pre-configured.
When using compose.yml, the realm is imported automatically on first start.
If not using the realm export:
-
Create realm:
stickermap -
Create client:
stickermap-client(OpenID Connect, public)- Redirect URIs:
http://localhost:4200/* - Web origins:
http://localhost:4200 - Enable standard flow and direct access grants
- Redirect URIs:
-
Create client roles on the
stickermap-clientclient:Role Description Composite roles sm-viewerCan view sticker details — sm-uploaderCan upload and edit own stickers sm-viewersm-editorCan edit any sticker sm-uploadersm-adminFull access sm-editor -
Create a
stickermapgroup with four sub-groups matching the roles:Group path Client role assigned /stickermap/sm-viewersm-viewer/stickermap/sm-uploadersm-uploader/stickermap/sm-editorsm-editor/stickermap/sm-adminsm-admin -
Set
/stickermap/sm-vieweras the default group:- Realm settings → User registration → Default groups → add
/stickermap/sm-viewer
- Realm settings → User registration → Default groups → add
Add the user to the appropriate sub-group under /stickermap/:
- Users → select a user
- Groups tab → Join Group
- Select
/stickermap/sm-uploader(orsm-editor/sm-admin) and click Join
Remove the user from /stickermap/sm-viewer if you want to prevent viewer access while they hold a higher role — though in practice composite roles make this unnecessary.
| Resource | Requirement |
|---|---|
/add-sticker (frontend) |
Any authenticated user |
POST /api/v1/upload |
sm-uploader |
POST /api/v1/create_sticker |
sm-uploader |
PATCH /api/v1/sticker/{id} |
sm-uploader (own) / sm-editor (any) / sm-admin (all fields) |
DELETE /api/v1/sticker/{id} |
sm-admin |
GET /api/v1/*, GET /uploads/* |
Public |
- RS256 asymmetric token signing
- Token signature validation against Keycloak JWKS endpoint
- Automatic access token refresh (checked every 60 s)
- HTTP interceptor injects Bearer token on all API requests
- 401/403 responses trigger re-login