Skip to content

Commit 16894f5

Browse files
authored
feat: theme for Keycloak 20 (#22)
* build: update Dockerfile to Keycloak 20.0 * feat: update styles for Keycloak 20.0
1 parent d923a73 commit 16894f5

3 files changed

Lines changed: 45 additions & 36 deletions

File tree

Dockerfile.dev

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM docker.io/jboss/keycloak:15.0.2
1+
FROM keycloak/keycloak:20.0.1
22

33
# Turn of caching in the configuration so we can modify the theme and refresh to see changes
44
COPY ./renku-theme-dev/standalone.xml /opt/jboss/keycloak/standalone/configuration/standalone.xml
55
COPY ./renku-theme-dev/standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml
66

77
# Set up a Renku realm
8-
COPY ./renku-theme-dev/renku-realm.json /tmp/renku-realm.json
8+
COPY ./renku-theme-dev/renku-realm.json /opt/keycloak/data/import/renku-realm.json
99

1010
# Copy the theme in, though this content will be overridden if you mount the folder when running
11-
COPY ./renku_theme/ /opt/jboss/keycloak/themes/renku_theme/
11+
COPY ./renku_theme/ /opt/keycloak/themes/renku_theme/

README.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,39 @@ For development, you can do the following:
1515
```
1616
docker build -f Dockerfile.dev -t renku-theme .
1717
18-
docker run -d --rm --name renku-theme -v (pwd)/renku_theme:/opt/jboss/keycloak/themes/renku_theme -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e KEYCLOAK_IMPORT=/tmp/renku-realm.json renku-theme
18+
docker run -d --rm --name renku-theme -v (pwd)/renku_theme:/opt/keycloak/themes/renku_theme -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin renku-theme start-dev --import-realm
1919
```
2020

21-
Then, after waiting for the service to start, connect to one of these urls (depending of if you are testing the account or login page):
22-
* http://localhost:8080/auth/realms/renku/account/
23-
* http://localhost:8080/auth/realms/renku/protocol/openid-connect/auth?client_id=account&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fauth%2Frealms%2Frenku%2Faccount%2Flogin-redirect&state=1234&response_type=code&scope=openid
21+
Then, after waiting for the service to start, connect to this URL
22+
23+
* http://localhost:8080/realms/renku/account/
24+
25+
From here, you can click _Sign In_ to get to the login UI.
26+
2427

2528
You can make changes to the theme and refresh in your browser to see the updates. You need to do a hard refresh (e.g., Shift-Refresh on Safari) or ensure the cache is disabled to see your changes.
2629

30+
## Local Testing
31+
32+
After the initial theme is set up, you should make some configuration changes to test several scenarios:
33+
34+
### Auth providers
35+
36+
Configure some auth providers like
37+
38+
- Facebook http://localhost:8080/admin/master/console/#/renku/identity-providers/facebook/add
39+
- GitHub http://localhost:8080/admin/master/console/#/renku/identity-providers/github/add
40+
41+
42+
These should then appear on the login page.
43+
44+
### Reset password page
45+
46+
Enable the reset password page to make sure that looks correct:
47+
48+
http://localhost:8080/admin/master/console/#/renku/realm-settings/login
49+
50+
2751
## Testing
2852

2953
If you want to deploy the theme in a real renku instance, you can build it and push it to docker hub, where you can reference it in a renku chart.
@@ -39,5 +63,4 @@ In the renku chart, change the `values.yaml` to reference the image in the `keyc
3963

4064
To understand the structure of the content, you may need to consult the source code for the theme.
4165

42-
Download the source for the release that is used (https://github.com/keycloak/keycloak/releases/tag/15.0.2) and then look in the `themes/src/main/resources/theme` folder for the `base` and `keycloak` templates. Official theme examples are found in `examples/themes/src/main/resources/theme` folder.
43-
66+
Download the source for the release that is used (https://github.com/keycloak/keycloak/releases/tag/20.0.1) and then look in the `themes/src/main/resources/theme` folder for the `base` and `keycloak` templates. Official theme examples are found in `examples/themes/src/main/resources/theme` folder.

renku_theme/login/resources/css/login.css

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
@import url("../../keycloak/lib/zocial/zocial.css");
19-
2018
.login-pf {
2119
background: #07182b;
2220
}
@@ -36,7 +34,7 @@
3634
}
3735

3836
h1 {
39-
font-size: 32px;
37+
font-size: 24px;
4038
}
4139

4240
.alert {
@@ -51,9 +49,7 @@ a {
5149
font-weight: bold;
5250
text-decoration: underline;
5351

54-
padding: 10px;
5552
margin-top: 20px;
56-
margin-right: 10px;
5753
}
5854

5955
.renku-login-container {
@@ -68,44 +64,32 @@ a {
6864

6965
.renku-login-card {
7066
position: relative;
71-
top: 120px;
67+
top: 20px;
7268
padding-bottom: 20px;
7369
}
7470

7571
#kc-content {
76-
width: 700px;
72+
width: 300px;
7773
}
7874

7975
#kc-content-wrapper {
8076
display: flex;
8177
flex-direction: column;
82-
justify-content: space-between;
83-
}
84-
85-
#kc-form {
86-
display: flex;
87-
justify-content: space-between;
88-
}
89-
90-
#kc-form-wrapper {
91-
padding-right: 40px;
9278
}
9379

9480
div#kc-social-providers {
95-
border-left: 1px solid #009568;
96-
padding-left: 20px;
97-
flex-grow: 1;
81+
background-color: rgba(7, 24, 43, 0.3);
9882
}
9983

10084
div#kc-social-providers hr {
101-
border-top: none;
85+
border-top: 1px solid #009568;
10286
margin: 0px;
10387
}
10488

10589
div#kc-social-providers h4 {
10690
font-size: 16px;
10791
font-weight: bold;
108-
margin: 5px 0px 5px 5px;
92+
margin: 10px 0px 5px 5px;
10993
}
11094

11195
#kc-form label {
@@ -118,7 +102,8 @@ div#kc-social-providers h4 {
118102
}
119103

120104
#kc-info {
121-
margin-top: 40px;
105+
margin-top: 10px;
106+
background-color: rgb(7, 24, 43);
122107
}
123108

124109
input[type="text"],
@@ -223,7 +208,6 @@ span.pf-m-error.required {
223208
margin-top: -15px;
224209
}
225210

226-
227211
div#kc-header {
228212
background-image: url("../img/logo.svg");
229213
background-size: cover;
@@ -251,10 +235,13 @@ div#kc-header-wrapper {
251235
width: 300px;
252236
}
253237

254-
#kc-info-wrapper {
255-
width: 400px;
238+
.kc-social-item {
239+
text-align: center;
256240
}
257241

242+
.kc-social-links {
243+
font-size: 14px;
244+
}
258245

259246
div#social-login {
260247
border-left: 1px solid rgba(255, 255, 255, 0.2);
@@ -299,7 +286,6 @@ div#kc-social-providers a {
299286

300287
margin: 0px;
301288
padding: 10px;
302-
width: 150px;
303289
}
304290

305291
div#kc-social-providers a:hover {

0 commit comments

Comments
 (0)