openapi.json 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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. "parameters": [
  111. {
  112. "name": "grant_type",
  113. "in": "query",
  114. "description": "Token type that should be granted",
  115. "required": true,
  116. "schema": {
  117. "type": "string"
  118. }
  119. },
  120. {
  121. "name": "code",
  122. "in": "query",
  123. "description": "Code of the flow",
  124. "schema": {
  125. "type": "string",
  126. "nullable": true
  127. }
  128. },
  129. {
  130. "name": "refresh_token",
  131. "in": "query",
  132. "description": "Refresh token",
  133. "schema": {
  134. "type": "string",
  135. "nullable": true
  136. }
  137. },
  138. {
  139. "name": "client_id",
  140. "in": "query",
  141. "description": "Client ID",
  142. "schema": {
  143. "type": "string",
  144. "nullable": true
  145. }
  146. },
  147. {
  148. "name": "client_secret",
  149. "in": "query",
  150. "description": "Client secret",
  151. "schema": {
  152. "type": "string",
  153. "nullable": true
  154. }
  155. }
  156. ],
  157. "responses": {
  158. "500": {
  159. "description": "",
  160. "content": {
  161. "text/plain": {
  162. "schema": {
  163. "type": "string"
  164. }
  165. }
  166. }
  167. },
  168. "200": {
  169. "description": "Token returned",
  170. "content": {
  171. "application/json": {
  172. "schema": {
  173. "type": "object",
  174. "required": [
  175. "access_token",
  176. "token_type",
  177. "expires_in",
  178. "refresh_token",
  179. "user_id"
  180. ],
  181. "properties": {
  182. "access_token": {
  183. "type": "string"
  184. },
  185. "token_type": {
  186. "type": "string"
  187. },
  188. "expires_in": {
  189. "type": "integer",
  190. "format": "int64"
  191. },
  192. "refresh_token": {
  193. "type": "string"
  194. },
  195. "user_id": {
  196. "type": "string"
  197. }
  198. }
  199. }
  200. }
  201. }
  202. },
  203. "400": {
  204. "description": "Getting token is not possible",
  205. "content": {
  206. "application/json": {
  207. "schema": {
  208. "type": "object",
  209. "required": [
  210. "error"
  211. ],
  212. "properties": {
  213. "error": {
  214. "type": "string"
  215. }
  216. }
  217. }
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. },
  225. "tags": []
  226. }