Utils

django_compref_keycloak.utils.is_federation_no_shibboleth(user)

Checks whether a user is authenticated, but not a TUM shibboleth account. Use this to allow other federated organizations, but not all TUM accounts.

Will be extended when more federations are configured by CompRef.

django_compref_keycloak.utils.is_fsmbtumde(user)

Check whether a user is a fsmb-tum.de account.

django_compref_keycloak.utils.is_fstumde(user)

Check whether a user is a fs.tum.de account.

django_compref_keycloak.utils.is_idp(user, idp)

Check whether a user is federated from a particular IDP.

Currently valid IDP values: - fs.tum.de - shibboleth.tum.de - fsmb-tum.de

django_compref_keycloak.utils.is_tum_shibboleth(user)

Check whether a user is a TUM shibboleth account.

django_compref_keycloak.utils.is_tum_shibboleth_affiliation(user, affiliations)

Checks whether a user is a TUM shibboleth account and whether it has the particular affiliation.

Common values for the affiliation: - student - employee - alum

affiliations can be a string or list of strings.

django_compref_keycloak.utils.is_tum_shibboleth_employee(user)

Checks whether a user is a TUM shibboleth account and whehter it is an employee.

django_compref_keycloak.utils.is_tum_shibboleth_org(user, orgs)

Checks whether a user is a TUM shibboleth account and whether it blongs to a particular org (“Zugehoerigkeit”). We only have the org for students and employees (not for guests - everyone else does not have an org).

This methods checks if the user belongs to an org as student or employee. If an user belongs to “TU1234” as student and to “TU5678” as employee, a check for both will return True.

orgs can be a string or list of strings.

django_compref_keycloak.utils.is_tum_shibboleth_student(user)

Checks whether a user is a TUM shibboleth account and whether it is a student.