openapi.json 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. "required": true,
  125. "schema": {
  126. "type": "string"
  127. }
  128. },
  129. {
  130. "name": "refresh_token",
  131. "in": "query",
  132. "description": "Refresh token",
  133. "required": true,
  134. "schema": {
  135. "type": "string"
  136. }
  137. },
  138. {
  139. "name": "client_id",
  140. "in": "query",
  141. "description": "Client ID",
  142. "required": true,
  143. "schema": {
  144. "type": "string"
  145. }
  146. },
  147. {
  148. "name": "client_secret",
  149. "in": "query",
  150. "description": "Client secret",
  151. "required": true,
  152. "schema": {
  153. "type": "string"
  154. }
  155. }
  156. ],
  157. "responses": {
  158. "200": {
  159. "description": "Token returned",
  160. "content": {
  161. "application/json": {
  162. "schema": {
  163. "type": "object",
  164. "required": [
  165. "access_token",
  166. "token_type",
  167. "expires_in",
  168. "refresh_token",
  169. "user_id"
  170. ],
  171. "properties": {
  172. "access_token": {
  173. "type": "string"
  174. },
  175. "token_type": {
  176. "type": "string"
  177. },
  178. "expires_in": {
  179. "type": "integer",
  180. "format": "int64"
  181. },
  182. "refresh_token": {
  183. "type": "string"
  184. },
  185. "user_id": {
  186. "type": "string"
  187. }
  188. }
  189. }
  190. }
  191. }
  192. },
  193. "400": {
  194. "description": "Getting token is not possible",
  195. "content": {
  196. "application/json": {
  197. "schema": {
  198. "type": "object",
  199. "required": [
  200. "error"
  201. ],
  202. "properties": {
  203. "error": {
  204. "type": "string"
  205. }
  206. }
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. },
  215. "tags": []
  216. }