fsr-de / myHPI

Django/Wagtail page serving myhpi.de
https://myhpi.de
11 stars 11 forks source link

migrate to keycloak as IDP #422

Closed jeriox closed 7 months ago

jeriox commented 7 months ago

Migrates users to use the new sub from OIDC claims

closes #336

frcroth commented 7 months ago

Can you provide test setup instructions?

jeriox commented 7 months ago

My testing looked as follows:

dasGoogle commented 7 months ago

As we now have set up some basic group management in our Keycloak, I'd suggest we also integrate that into this PR.

@frcroth In case you want to test the setup yourself, please contact me or @lukasrad02 directly so we can give you some testing credentials.

jeriox commented 7 months ago

@dasGoogle yep that was the plan, can you provide me with some infos on how the groups look in the OIDC claim or do I have to figure that out on my own? :D (would probably be good to write that down somewhere for the future anyways)

dasGoogle commented 7 months ago

There will most likely (not Setup yet) a claim called "role", containing an array of arbitrary strings, each of which being a unique identifier for a group. @lukasrad02 and I expect that this mapping of ID to actual myHPI group would happen based on an attribute on each myHPI Group.

jeriox commented 7 months ago

After another discussion with @dasGoogle we decided against a separate identifier for the groups and will instead use the group name directly (e.g. "student"). We could change our templates to capitalize the group names for the UI

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 7116695497


Changes Missing Coverage Covered Lines Changed/Added Lines %
myhpi/core/auth.py 13 15 86.67%
myhpi/core/models.py 5 7 71.43%
<!-- Total: 24 28 85.71% -->
Files with Coverage Reduction New Missed Lines %
myhpi/core/auth.py 1 87.88%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 6850993127: -0.03%
Covered Lines: 1235
Relevant Lines: 1663

💛 - Coveralls