diff --git a/docs/tutorial/tutorial_06.rst b/docs/tutorial/tutorial_06.rst index 386e4ef39..6933d20ce 100644 --- a/docs/tutorial/tutorial_06.rst +++ b/docs/tutorial/tutorial_06.rst @@ -29,6 +29,8 @@ but generally, it is assumed the device is unable to safely store the client sec Ensure the setting ``OAUTH_DEVICE_VERIFICATION_URI`` is set to a URI you want to return in the `verification_uri` key in the response. This is what the device will display to the user. +Optionally, configure ``OAUTH_DEVICE_VERIFICATION_URI_COMPLETE`` to something like +``http://127.0.0.1:8000/o/device?user_code={user_code}``. 1. Navigate to the tests/app/idp directory: diff --git a/oauth2_provider/views/device.py b/oauth2_provider/views/device.py index f3dccf2ba..21ad4f59e 100644 --- a/oauth2_provider/views/device.py +++ b/oauth2_provider/views/device.py @@ -99,6 +99,9 @@ def get_success_url(self): }, ) + def get_initial(self): + return {"user_code": self.request.GET.get("user_code", "")} + def form_valid(self, form): """ Sets the device_grant on the instance so that it can be accessed