Skip to content

Are claims available to Django Views in request to do custom permission check? #341

@sachingaikwad123

Description

@sachingaikwad123

Client: React SPA
Web API: Django Backend REST API
Azure AD (only cloud)

I am able to test 'authentication' and 'web api call' with access token. I would like to implement RBAC in Django Backend Web APIs. For this, I am getting 'claims' in token as well. [I created app roles in Azure AD App Registration page for this].

  1. Now, I would like to do some custom permission checks in some 'views' (APIs) based on roles. How to access 'claims' value in 'views'? Should 'request.auth' have claims'? There is no documentation regarding this.
  2. What is recommended/best approach to implement RBAC in such setup? Should I map 'roles' to Django 'groups'? Can we add some documentation/help guide for this scenario using this django package/lib?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions