Bug 20402: Implement OAuth2 authentication for REST API
[koha.git] / api / v1 / swagger / paths / oauth.json
1 {
2     "/oauth/token": {
3         "post": {
4             "x-mojo-to": "OAuth#token",
5             "operationId": "tokenOAuth",
6             "tags": ["oauth"],
7             "produces": [
8                 "application/json"
9             ],
10             "parameters": [
11                 {
12                     "name": "grant_type",
13                     "in": "formData",
14                     "description": "grant type (client_credentials)",
15                     "required": true,
16                     "type": "string"
17                 },
18                 {
19                     "name": "client_id",
20                     "in": "formData",
21                     "description": "client id",
22                     "type": "string"
23                 },
24                 {
25                     "name": "client_secret",
26                     "in": "formData",
27                     "description": "client secret",
28                     "type": "string"
29                 }
30             ],
31             "responses": {
32                 "200": {
33                     "description": "OK",
34                     "schema": {
35                         "type": "object",
36                         "properties": {
37                             "access_token": {
38                                 "type": "string"
39                             },
40                             "token_type": {
41                                 "type": "string"
42                             },
43                             "expires_in": {
44                                 "type": "integer"
45                             }
46                         }
47                     }
48                 },
49                 "400": {
50                     "description": "Bad Request",
51                     "schema": {
52                         "$ref": "../definitions.json#/error"
53                     }
54                 },
55                 "403": {
56                     "description": "Access forbidden",
57                     "schema": {
58                         "$ref": "../definitions.json#/error"
59                     }
60                 }
61             }
62         }
63     }
64 }