openapi.json 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "oauth2",
  5. "version": "0.0.1",
  6. "description": "Allows OAuth2 compatible authentication from other web applications.",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {}
  23. },
  24. "paths": {
  25. "/index.php/apps/oauth2/authorize": {
  26. "get": {
  27. "operationId": "login_redirector-authorize",
  28. "summary": "Authorize the user",
  29. "tags": [
  30. "login_redirector"
  31. ],
  32. "security": [
  33. {},
  34. {
  35. "bearer_auth": []
  36. },
  37. {
  38. "basic_auth": []
  39. }
  40. ],
  41. "parameters": [
  42. {
  43. "name": "client_id",
  44. "in": "query",
  45. "description": "Client ID",
  46. "required": true,
  47. "schema": {
  48. "type": "string"
  49. }
  50. },
  51. {
  52. "name": "state",
  53. "in": "query",
  54. "description": "State of the flow",
  55. "required": true,
  56. "schema": {
  57. "type": "string"
  58. }
  59. },
  60. {
  61. "name": "response_type",
  62. "in": "query",
  63. "description": "Response type for the flow",
  64. "required": true,
  65. "schema": {
  66. "type": "string"
  67. }
  68. }
  69. ],
  70. "responses": {
  71. "200": {
  72. "description": "Client not found",
  73. "content": {
  74. "text/html": {
  75. "schema": {
  76. "type": "string"
  77. }
  78. }
  79. }
  80. },
  81. "303": {
  82. "description": "Redirect to login URL",
  83. "headers": {
  84. "Location": {
  85. "schema": {
  86. "type": "string"
  87. }
  88. }
  89. }
  90. }
  91. }
  92. }
  93. },
  94. "/index.php/apps/oauth2/api/v1/token": {
  95. "post": {
  96. "operationId": "oauth_api-get-token",
  97. "summary": "Get a token",
  98. "tags": [
  99. "oauth_api"
  100. ],
  101. "security": [
  102. {},
  103. {
  104. "bearer_auth": []
  105. },
  106. {
  107. "basic_auth": []
  108. }
  109. ],
  110. "requestBody": {
  111. "required": true,
  112. "content": {
  113. "application/json": {
  114. "schema": {
  115. "type": "object",
  116. "required": [
  117. "grant_type"
  118. ],
  119. "properties": {
  120. "grant_type": {
  121. "type": "string",
  122. "description": "Token type that should be granted"
  123. },
  124. "code": {
  125. "type": "string",
  126. "nullable": true,
  127. "description": "Code of the flow"
  128. },
  129. "refresh_token": {
  130. "type": "string",
  131. "nullable": true,
  132. "description": "Refresh token"
  133. },
  134. "client_id": {
  135. "type": "string",
  136. "nullable": true,
  137. "description": "Client ID"
  138. },
  139. "client_secret": {
  140. "type": "string",
  141. "nullable": true,
  142. "description": "Client secret"
  143. }
  144. }
  145. }
  146. }
  147. }
  148. },
  149. "responses": {
  150. "500": {
  151. "description": "",
  152. "content": {
  153. "text/plain": {
  154. "schema": {
  155. "type": "string"
  156. }
  157. }
  158. }
  159. },
  160. "200": {
  161. "description": "Token returned",
  162. "content": {
  163. "application/json": {
  164. "schema": {
  165. "type": "object",
  166. "required": [
  167. "access_token",
  168. "token_type",
  169. "expires_in",
  170. "refresh_token",
  171. "user_id"
  172. ],
  173. "properties": {
  174. "access_token": {
  175. "type": "string"
  176. },
  177. "token_type": {
  178. "type": "string"
  179. },
  180. "expires_in": {
  181. "type": "integer",
  182. "format": "int64"
  183. },
  184. "refresh_token": {
  185. "type": "string"
  186. },
  187. "user_id": {
  188. "type": "string"
  189. }
  190. }
  191. }
  192. }
  193. }
  194. },
  195. "400": {
  196. "description": "Getting token is not possible",
  197. "content": {
  198. "application/json": {
  199. "schema": {
  200. "type": "object",
  201. "required": [
  202. "error"
  203. ],
  204. "properties": {
  205. "error": {
  206. "type": "string"
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. }
  216. },
  217. "tags": []
  218. }