-
Notifications
You must be signed in to change notification settings - Fork 25
/
oauthapi.json
251 lines (251 loc) · 6.48 KB
/
oauthapi.json
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
{
"openapi": "3.0.1",
"info": {
"title": "OAuth API",
"description": "This is API for supporting OAuth flow",
"version": "0.1"
},
"paths": {
"/oauth2/authorization-request-uri": {
"get": {
"description": "Get authorization uri",
"parameters": [
{
"name": "state",
"in": "query",
"schema": {
"type": "string"
},
"example": "my_state"
},
{
"name": "scope",
"in": "query",
"schema": {
"type": "string",
"enum": ["ais", "ais_balances", "ais_transactions", "pis"]
},
"example": "ais"
},
{
"name": "redirect_uri",
"in": "query",
"schema": {
"type": "string"
},
"example": "http://localhost:8080/redirect"
},
{
"name": "sca_oauth_link",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "consent_id",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "payment_id",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "code_challenge_method",
"in": "query",
"schema": {
"type": "string",
"default": "S256"
},
"example": "S256",
"description": "A method that was used to derive code challenge. [rfc7636]"
},
{
"name": "code_challenge",
"in": "query",
"schema": {
"type": "string"
},
"example": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"description": "A challenge derived from the code verifier that is sent in the authorization request, to be verified against later. [rfc7636]"
},
{
"name": "X-GTW-ASPSP-ID",
"in": "header",
"schema": {
"type": "string"
},
"example": "f60271e2-7157-41fd-97f6-84844f28e637"
}
],
"responses": {
"200": {
"description": "IDP URI will be returned",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/idpUri"
},
"example": {
"href": "https://link-to-the-idp/login-page"
}
}
}
},
"400": {
"description": "When operation doesn't supported by the adapter"
}
},
"tags": [
"OAuth operations"
]
}
},
"/oauth2/token": {
"post": {
"description": "Exchange autorization code by bearer token endpoint",
"parameters": [
{
"name": "grant_type",
"in": "query",
"schema": {
"type": "string"
},
"example": "authorization_code"
},
{
"name": "code",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "redirect_uri",
"in": "query",
"schema": {
"type": "string"
},
"example": "http://localhost:8080/redirect"
},
{
"name": "sca_oauth_link",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "client_id",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "refresh_token",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "scope",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "code_verifier",
"in": "query",
"schema": {
"type": "string"
},
"example": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
"description": "A cryptographically random string that is used to correlate the authorization request to the token request. [rfc7636]"
},
{
"name": "X-GTW-ASPSP-ID",
"in": "header",
"schema": {
"type": "string"
},
"example": "f60271e2-7157-41fd-97f6-84844f28e637"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/accessToken"
},
"example": {
"scope": "AIS:VALID_CONSENT_ID",
"access_token": "4496e9e2e82b4aa182db8f994a361c46a6736914cd4843d68eab166d4a41cf5c510d087cb1b946ff83b2494a1f5228a0",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "a10149d1b74b4108acb632e61f9efeb7d03a76deb8d840539b5219ebb486f213bed1c159ccd04234b9794f8da9ed69a4"
}
}
}
},
"403": {
"description": "When authorization code is wrong or expired"
}
},
"tags": [
"OAuth operations"
]
}
}
},
"components": {
"schemas": {
"idpUri": {
"description": "IDP uri",
"type": "object",
"properties": {
"href": {
"type": "string",
"example": "/v1/payments/sepa-credit-transfers/1234-wertiq-983"
}
}
},
"accessToken": {
"description": "Bearer token object",
"type": "object",
"properties": {
"scope": {
"type": "string",
"example": "AIS PIS"
},
"access_token": {
"type": "string",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
},
"token_type": {
"type": "string",
"example": "Bearer"
},
"expires_in": {
"type": "integer",
"example": 3600
},
"refresh_token": {
"type": "string",
"example": "refresh-token"
}
}
}
}
}
}