Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leave control of is_superuser status with Django by default #14

Closed
Andras1000 opened this issue Mar 31, 2021 · 2 comments
Closed

Leave control of is_superuser status with Django by default #14

Andras1000 opened this issue Mar 31, 2021 · 2 comments

Comments

@Andras1000
Copy link

Andras1000 commented Mar 31, 2021

In tokens.py the is_superuser status of a user will always be overwritten by this library.

user.is_superuser = bool(
    self.config.superuser_group
    and "groups" in claims
    and self.config.superuser_group in claims["groups"]
)

Make this code optional via settings so when an existing user is authenticated the already existing is_superuser status can be used.

I ran into this limitation as the groups scope is not returned in the flow unless one has the API Access Management feature in Okta which allows custom authorization server (see here), so could not use the SUPERUSER_GROUP setting.

Same applies to is_staff.

@Andras1000 Andras1000 changed the title Allow to leave control of is_superuser status with Django Leave control of is_superuser status with Django by default Mar 31, 2021
@samkuehn
Copy link
Contributor

samkuehn commented Apr 1, 2021

I am having the same issue. Here are my comments/suggestions on another issue.

#8 (comment)

@AzMoo
Copy link
Owner

AzMoo commented Mar 13, 2023

Resolved in #28

@AzMoo AzMoo closed this as completed Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants