@@ -4,6 +4,8 @@ Management commands
44Django 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
810cleartokens
911~~~~~~~~~~~ 
@@ -21,3 +23,39 @@ To prevent the CPU and RAM high peaks during deletion process use ``CLEAR_EXPIRE
2123
2224Note: Refresh tokens need to expire before AccessTokens can be removed from the
2325database. 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+ 
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