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

Generate scopes based on user permissions #518

Open
marcosvsmorais opened this issue Oct 13, 2017 · 1 comment
Open

Generate scopes based on user permissions #518

marcosvsmorais opened this issue Oct 13, 2017 · 1 comment

Comments

@marcosvsmorais
Copy link

Hello Guys
I need to generate scopes based on user (Django) permissions
This is possible?
Every time that i am generating a token, the scopes is only "scope": "read write"
I know how scopes works, and i have made tests, but i do it, editing Access tokens scopes on Django Admin

I need to generate the token with the correctly scopes, based on Users.

@muktadiur
Copy link

when you call token api you could provide scope also:
curl -X POST -d "grant_type=password&username=USERNAME&password=PASSWORD&scope=SCOPE1 SCOPE2" -u”APPLICATION_ID:SECRET_KEY" BASE_URL/o/token/

Now your token should have scope: SCOPE1, SCOPE2. You could also set the default scope on settings: 'DEFAULT_SCOPES': ['read', 'write', 'SCOPE1', 'SCOPE2']

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

2 participants