summary refs log tree commit diff
path: root/docs/client-server/swagger_matrix/api-docs-login
blob: d6f8d84f29efef732edc588f50ec6fee71d6be9a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{
  "apiVersion": "1.0.0", 
  "apis": [
    {
      "operations": [
        {
          "method": "GET", 
          "nickname": "get_login_info", 
          "notes": "All login stages MUST be mentioned if there is >1 login type.", 
          "summary": "Get the login mechanism to use when logging in.", 
          "type": "LoginFlows"
        }, 
        {
          "method": "POST", 
          "nickname": "submit_login", 
          "notes": "If this is part of a multi-stage login, there MUST be a 'session' key.", 
          "parameters": [
            {
              "description": "A login submission", 
              "name": "body", 
              "paramType": "body", 
              "required": true, 
              "type": "LoginSubmission"
            }
          ], 
          "responseMessages": [
            {
              "code": 400, 
              "message": "Bad login type"
            }, 
            {
              "code": 400, 
              "message": "Missing JSON keys"
            }
          ], 
          "summary": "Submit a login action.", 
          "type": "LoginResult"
        }
      ], 
      "path": "/login"
    }
  ], 
  "basePath": "http://localhost:8008/_matrix/client/api/v1", 
  "consumes": [
    "application/json"
  ], 
  "models": {
    "LoginFlows": {
      "id": "LoginFlows",
      "properties": {
        "flows": {
          "description": "A list of valid login flows.",
          "type": "array",
          "items": {
            "$ref": "LoginInfo"
          }
        }
      }
    },
    "LoginInfo": {
      "id": "LoginInfo", 
      "properties": {
        "stages": {
          "description": "Multi-stage login only: An array of all the login types required to login.", 
          "items": {
            "$ref": "string"
          }, 
          "type": "array"
        }, 
        "type": {
          "description": "The login type that must be used when logging in.", 
          "type": "string"
        }
      }
    }, 
    "LoginResult": {
      "id": "LoginResult", 
      "properties": {
        "access_token": {
          "description": "The access token for this user's login if this is the final stage of the login process.", 
          "type": "string"
        },
        "user_id": {
          "description": "The user's fully-qualified user ID.",
          "type": "string"
        }, 
        "next": {
          "description": "Multi-stage login only: The next login type to submit.", 
          "type": "string"
        },
        "session": {
          "description": "Multi-stage login only: The session token to send when submitting the next login type.",
          "type": "string"
        }
      }
    }, 
    "LoginSubmission": {
      "id": "LoginSubmission", 
      "properties": {
        "type": {
          "description": "The type of login being submitted.", 
          "type": "string"
        },
        "session": {
          "description": "Multi-stage login only: The session token from an earlier login stage.",
          "type": "string"
        },
        "_login_type_defined_keys_": {
          "description": "Keys as defined by the specified login type, e.g. \"user\", \"password\""
        }
      }
    }
  }, 
  "produces": [
    "application/json"
  ], 
  "resourcePath": "/login", 
  "swaggerVersion": "1.2"
}