Skip to content

Commit 0d3d163

Browse files
committed
feat: default user profile config
1 parent 4b38a88 commit 0d3d163

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

docker/keycloak/Dockerfile-24

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ COPY ./configuration/24/keycloak.conf /opt/keycloak/conf
3030

3131
COPY ./configuration/24/quarkus.properties /opt/keycloak/conf
3232

33+
COPY ./configuration/keycloak-default-user-profile.json /tmp
34+
3335
# change these values to point to a running postgres instance
3436
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"unmanagedAttributePolicy": "ENABLED",
3+
"attributes": [
4+
{
5+
"name": "username",
6+
"displayName": "${username}",
7+
"permissions": {
8+
"view": ["admin", "user"],
9+
"edit": ["admin", "user"]
10+
},
11+
"validations": {
12+
"length": { "min": 3, "max": 255 },
13+
"username-prohibited-characters": {},
14+
"up-username-not-idn-homograph": {}
15+
}
16+
},
17+
{
18+
"name": "email",
19+
"displayName": "${email}",
20+
"permissions": {
21+
"view": ["admin", "user"],
22+
"edit": ["admin", "user"]
23+
},
24+
"validations": {
25+
"email": {},
26+
"length": { "max": 255 }
27+
}
28+
},
29+
{
30+
"name": "firstName",
31+
"displayName": "${firstName}",
32+
"permissions": {
33+
"view": ["admin", "user"],
34+
"edit": ["admin", "user"]
35+
},
36+
"validations": {
37+
"length": { "max": 255 },
38+
"person-name-prohibited-characters": {}
39+
}
40+
},
41+
{
42+
"name": "lastName",
43+
"displayName": "${lastName}",
44+
"permissions": {
45+
"view": ["admin", "user"],
46+
"edit": ["admin", "user"]
47+
},
48+
"validations": {
49+
"length": { "max": 255 },
50+
"person-name-prohibited-characters": {}
51+
}
52+
}
53+
],
54+
"groups": [
55+
{
56+
"name": "user-metadata",
57+
"displayHeader": "User metadata",
58+
"displayDescription": "Attributes, which refer to user metadata"
59+
}
60+
]
61+
}

docker/keycloak/configuration/24/keycloak.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ log-file-output=json
2222

2323
# SPIs
2424
spi-login-protocol-openid-connect-legacy-logout-redirect-uri=true
25+
spi-user-profile-declarative-user-profile-config-file=/tmp/keycloak-default-user-profile.json
2526

2627
# cache
2728
cache=ispn

0 commit comments

Comments
 (0)