Skip to content

Commit 6dbd814

Browse files
schlizpablo-schmeiser
authored andcommitted
chore: introduce oidc dev environment
1 parent d5efcc0 commit 6dbd814

6 files changed

Lines changed: 546 additions & 2 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@schliz @hd1ex @mfbehrens @pablo-schmeiser
1+
* @schliz @hd1ex @mfbehrens @pablo-schmeiser

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,27 @@ python src/manage.py runserver
6868

6969
After that you can access your local shiftings instance at <http://127.0.0.1:8000/>.
7070

71+
#### OIDC login with Keycloak (recommended)
72+
73+
For development with OIDC authentication (matching the production setup), a local Keycloak instance is provided via Docker Compose:
74+
75+
```shell
76+
docker compose -f docker-compose.dev.yml up -d
77+
```
78+
79+
Then copy the dev settings template (if you haven't already):
80+
81+
```shell
82+
cp src/shiftings/local_settings.dev.py src/shiftings/local_settings.py
83+
```
84+
85+
Alternatively, `setup_dev.sh` does both the settings copy and database setup in one step.
86+
87+
The Keycloak admin console is available at <http://localhost:8080> (admin/admin). All test users (see below) can log in via SSO with the password `password`. The login page will show both "Login with local Account" and "Login via Single Sign-On" options.
88+
7189
#### User fixtures
7290

73-
In development mode you can switch between the pre-defined user fixtures with a button in the context menu at the top right of the web page or you can login using the lower case name as username and password (`bob`, `perry` etc.). **Bob** is a superuser and has access to the [Django admin page](http://127.0.0.1:8000/admin/) and **Perry** is a staff member. The other users have [different access to the first example organization](http://127.0.0.1:8000/organizations/1/admin/) provided by the fixture. Follow the provided links for more info.
91+
In development mode you can switch between the pre-defined user fixtures with a button in the context menu at the top right of the web page or you can login using the lower case name as username and password (`bob`, `perry` etc.) for local login, or via SSO with the password `password`. **Bob** is a superuser and has access to the [Django admin page](http://127.0.0.1:8000/admin/) and **Perry** is a staff member. The other users have [different access to the first example organization](http://127.0.0.1:8000/organizations/1/admin/) provided by the fixture. Follow the provided links for more info.
7492

7593
#### Upgrade Django version
7694

docker-compose.dev.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
keycloak:
3+
image: quay.io/keycloak/keycloak:26.2
4+
command: start-dev --import-realm
5+
environment:
6+
KC_BOOTSTRAP_ADMIN_USERNAME: admin
7+
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
8+
ports:
9+
- "8080:8080"
10+
volumes:
11+
- ./keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro

0 commit comments

Comments
 (0)