diff --git a/docs/reference/property-mappings/user-object.md b/docs/reference/property-mappings/user-object.md new file mode 100644 index 000000000..8cc35c162 --- /dev/null +++ b/docs/reference/property-mappings/user-object.md @@ -0,0 +1,20 @@ +# Passbook User Object + +The User object has the following attributes: + + - `username`: User's Username + - `email` User's E-Mail + - `name` User's Display Name + - `is_staff` Boolean field if user is staff + - `is_active` Boolean field if user is active + - `date_joined` Date User joined/was created + - `password_change_date` Date Password was last changed + - `attributes` Dynamic Attributes + +## Examples + +List all the User's Group Names + +```jinja2 +[{% for group in user.groups.all() %}'{{ group.name }}',{% endfor %}] +``` diff --git a/mkdocs.yml b/mkdocs.yml index efda66a94..bd2251ab4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,6 +19,9 @@ nav: - Rancher: integrations/services/rancher/index.md - Harbor: integrations/services/harbor/index.md - Sentry: integrations/services/sentry/index.md + - Reference: + - Property Mappings: + - User Object: reference/property-mappings/user-object.md repo_name: "BeryJu.org/passbook" repo_url: https://github.com/BeryJu/passbook diff --git a/passbook/providers/saml/forms.py b/passbook/providers/saml/forms.py index 7c305187a..11f9c1dc2 100644 --- a/passbook/providers/saml/forms.py +++ b/passbook/providers/saml/forms.py @@ -59,6 +59,8 @@ class SAMLProviderForm(forms.ModelForm): class SAMLPropertyMappingForm(forms.ModelForm): """SAML Property Mapping form""" + template_name = "saml/idp/property_mapping_form.html" + class Meta: model = SAMLPropertyMapping diff --git a/passbook/providers/saml/templates/saml/idp/property_mapping_form.html b/passbook/providers/saml/templates/saml/idp/property_mapping_form.html new file mode 100644 index 000000000..792be3c6d --- /dev/null +++ b/passbook/providers/saml/templates/saml/idp/property_mapping_form.html @@ -0,0 +1,19 @@ +{% extends "generic/form.html" %} + +{% load i18n %} + +{% block beneath_form %} +
+ Expression using Jinja. Following variables are available: +
ldap
: A Dictionary of all values retrieved from LDAP.