How to protect a view with client ID and client secret in REST / oauth toolkit?

29 views
Skip to first unread message

Daniel Grace

unread,
Jul 6, 2015, 1:35:27 PM7/6/15
to django...@googlegroups.com
Say I have a REST view:

class CreateUserView(generics.CreateAPIView):
    serializer_class = CreateUserSerializer
    queryset = User.objects.all()

...how is it possible to protect the view with the client ID and client secret from the oauth toolkit?

So that I can invoke the view via a special request like:
curl -X POST http://127.0.0.1:8000/user-create/ -d "client_id=<client_id>&client_secret=<client_secret>&username=andrew&password=andrew&first_name=Andrew&last_name=Bonvix"

Daniel Grace

unread,
Jul 7, 2015, 9:48:07 PM7/7/15
to django...@googlegroups.com
I guess there are more standard ways of protecting a view.

Reply all
Reply to author
Forward
0 new messages