Skip to content

Commit de0db70

Browse files
committed
Add documentation for 'createapplication' command to 'management_commands.rst'
1 parent 2928215 commit de0db70

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/management_commands.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Management commands
44
Django OAuth Toolkit exposes some useful management commands that can be run via shell or by other means (eg: cron)
55

66
.. _cleartokens:
7+
.. _createapplication:
8+
79

810
cleartokens
911
~~~~~~~~~~~
@@ -21,3 +23,39 @@ To prevent the CPU and RAM high peaks during deletion process use ``CLEAR_EXPIRE
2123

2224
Note: Refresh tokens need to expire before AccessTokens can be removed from the
2325
database. Using ``cleartokens`` without ``REFRESH_TOKEN_EXPIRE_SECONDS`` has limited effect.
26+
27+
28+
29+
createapplication
30+
~~~~~~~~~~~~~~~~~
31+
32+
The ``createapplication`` management command provides a shortcut to create a new application in a programmatic way.
33+
34+
This command is used like this:
35+
36+
.. code-block:: sh
37+
38+
python3 manage.py createapplication [arguments] <client_type> <authorization_grant_type>
39+
40+
41+
This command provides the following arguments:
42+
43+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
44+
| Argument | type | Description |
45+
+============================+======+=================================================================================================+
46+
| `--client_id` | str | The ID of the new application |
47+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
48+
| `--user` | int | The ID of the user that the application belongs to |
49+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
50+
| `--redirect-uris` | str | The redirect URIs. This must be a space-separated string (e.g., `"https://uri1/ https://uri2"`) |
51+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
52+
| `--name` | str | The name of this application |
53+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
54+
| `--skip-authorization` | flag | If set, completely bypass the authorization form, even on the first use of the application |
55+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
56+
| `--algorithm` | str | The OIDC token signing algorithm for this application (e.g., `RS256` or `HS256`) |
57+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
58+
| `client_type` | str | The client type, can be `confidential` or `public` |
59+
+----------------------------+------+-------------------------------------------------------------------------------------------------+
60+
| `authorization_grant_type` | str | The type of authorization grant to be used |
61+
+----------------------------+------+-------------------------------------------------------------------------------------------------+

0 commit comments

Comments
 (0)