User properties and attributes
Object properties
The User object has the following properties:
-
username
: User's username. -
email
User's email. -
uid
User's unique ID -
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. -
path
User's path, see Path -
attributes
Dynamic attributes, see Attributes -
group_attributes()
Merged attributes of all groups the user is member of and the user's own attributes. -
ak_groups
This is a queryset of all the user's groups.You can do additional filtering like:
user.ak_groups.filter(name__startswith='test')
For Django field lookups, see here.
To get the name of all groups, you can use this command:
[group.name for group in user.ak_groups.all()]
Examples
List all the User's group names:
for group in user.ak_groups.all():
yield group.name
Path
Requires authentik 2022.7
Paths can be used to organize users into folders depending on which source created them or organizational structure. Paths may not start or end with a slash, but they can contain any other character as path segments. The paths are currently purely used for organization, it does not affect their permissions, group memberships, or anything else.
Attributes
goauthentik.io/user/can-change-username
Optional flag, when set to false prevents the user from changing their own username.