-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.js
439 lines (415 loc) · 9.46 KB
/
config.js
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
'use strict';
/**
* @license
* Copyright SOAJS All Rights Reserved.
*
* Use of this source code is governed by an Apache license that can be
* found in the LICENSE file at the root of this repository
*/
module.exports = {
"type": 'service',
'subType': 'soajs',
"description": "SOAJS oAuth provides out of the box oAuth 2.0 functionality to validate, refresh and kill generated access tokens without the effort of writing any code.",
"prerequisites": {
"cpu": '',
"memory": ''
},
"serviceVersion": 1,
"serviceName": "oauth",
"serviceGroup": "Gateway",
"servicePort": 4002,
"requestTimeout": 30,
"requestTimeoutRenewal": 5,
"extKeyRequired": true,
"oauth": true,
'awareness': false,
"maintenance": {
"readiness": "/heartbeat",
"port": { "type": "maintenance" },
"commands": [
{ "label": "Reload Provision", "path": "/loadProvision", "icon": "fas fa-download" },
{ "label": "Reload Registry", "path": "/reloadRegistry", "icon": "fas fa-undo" },
{ "label": "Resource Info", "path": "/resourceInfo", "icon": "fas fa-info" }
]
},
"tags": ["authentication", "oauth2", "jwt", "multitenant"],
"attributes": {
"thirdparty": ["facebook", "google", "twitter", "github", "linkedin"],
"active directory": ["LDAP", "Azure AD"]
},
"program": ["soajs"],
"documentation": {
"readme": "/README.md",
"release": "/RELEASE.md"
},
//-------------------------------------
"hashIterations": 12,
"loginMode": "oauth",
"oauthService": {
"name": "oauth",
"tokenApi": "/token",
"authorizationApi": "/authorization"
},
"oauthServer": {
"grants": [
"password",
"refresh_token"
],
"debug": false,
"accessTokenLifetime": 7200,
"refreshTokenLifetime": 1209600
},
"errors": {
400: "Business logic required data are missing.",
401: "Unable to log in. Credential error or mismatch",
403: "User does not have access to this tenant",
404: "Unable to roam the provided request",
406: "Missing Tenant secret",
411: "Third party integration mapProfile error",
412: "Third party integration profile is empty",
413: "Unable to log in. Credential error or mismatch",
414: "Local login is not allowed",
420: "Missing service key configuration for third party integration",
421: "Service key configuration for third party integration is not complete",
422: "Unable to get driver: ",
423: "Error getting driver configuration",
450: "You do not have privileges to enable pin login",
451: "Pin login is not available for this account",
599: "Token has expired.",
600: "Error in generating oAUth Token.",
601: "Model not found.",
602: "Model error: ",
700: "Unable to log in. Ldap connection refused!",
701: "Unable to log in. Invalid ldap admin user.",
702: "Unable to log in. Invalid ldap admin credentials.",
703: "Unable to log in. Invalid ldap user credentials.",
704: "Unable to log in. Ldap user not found.",
705: "Unable to log in. Authentication failed.",
710: "Unable to log in. OpenAM connection error.",
711: "Unable to log in. OpenAM token invalid.",
713: "Unable to log in. General error while parsing response",
720: "Unable to authenticated with third party"
},
"schema": {
"commonFields": {},
"get": {
"/roaming": {
"_apiInfo": {
"l": "Cross environment roaming, but requires IP whitelisting",
"group": "Tokenization user"
}
},
"/available/login": {
"_apiInfo": {
"l": "Get information about what third party login is available",
"group": "Guest"
}
},
"/authorization": {
"_apiInfo": {
"l": "Get the authorization token",
"group": "Guest"
}
},
"/passport/login/:strategy": {
"_apiInfo": {
"l": "Passport login",
"group": "Third party login"
},
"strategy": {
"source": ['params.strategy'],
"required": true,
"validation": {
"type": "string",
"enum": ["facebook", "google", "twitter", "github", "azure", "linkedin"]
}
}
},
"/passport/validate/:strategy": {
"_apiInfo": {
"l": "Passport login validation",
"group": "Third party login"
},
"strategy": {
"source": ['params.strategy'],
"required": true,
"validation": {
"type": "string",
"enum": ["facebook", "google", "twitter", "github", "azure", "linkedin"]
}
},
"oauth_token": {
"source": ['query.oauth_token'],
"required": false,
"validation": {
"type": "string"
}
},
"oauth_verifier": {
"source": ['query.oauth_verifier'],
"required": false,
"validation": {
"type": "string"
}
}
}
},
"post": {
"/openam/login": {
"_apiInfo": {
"l": "OpenAM login",
"group": "Third party login"
},
"token": {
"source": ['body.token'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/ldap/login": {
"_apiInfo": {
"l": "Ldap login",
"group": "Third party login"
},
"username": {
"source": ['body.username'],
"required": true,
"validation": {
"type": "string"
}
},
"password": {
"source": ['body.password'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/token/phone": {
"_apiInfo": {
"l": "Create a verification code for that phone",
"group": "Guest"
},
"phone": {
"source": ['body.phone'],
"required": true,
"validation": {
"type": "string"
}
},
"type": {
"source": ["body.type"],
"default": "sms",
"validation": {
"type": "string",
"enum": ["sms", "whatsapp"]
}
}
},
"/token/phone/code": {
"_apiInfo": {
"l": "Create an access token for that phone",
"group": "Guest"
},
"code": {
"source": ['body.code'],
"required": true,
"validation": {
"type": "string"
}
},
"phone": {
"source": ['body.phone'],
"required": true,
"validation": {
"type": "string"
}
},
"unique": {
"source": ['body.unique'],
"default": false,
"validation": {
"type": "boolean"
}
}
},
"/token/auto/:id": {
"_apiInfo": {
"l": "Create an access token",
"group": "Internal"
},
"id": {
"source": ['params.id'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/token": {
"_apiInfo": {
"l": "Create an access token",
"group": "Guest"
},
"username": {
"source": ['body.username'],
"required": false,
"validation": {
"type": "string"
}
},
"password": {
"source": ['body.password'],
"required": false,
"validation": {
"type": "string"
}
},
"grant_type": {
"source": ['body.grant_type'],
"required": false,
"default": "password",
"validation": {
"type": "string",
"enum": ["refresh_token", "password"]
}
},
"refresh_token": {
"source": ['body.refresh_token'],
"required": false,
"validation": {
"type": "string"
}
}
},
"/token/email": {
"_apiInfo": {
"l": "Create an access token by email or username",
"group": "Guest"
},
"username": {
"source": ['body.username'],
"required": true,
"validation": {
"type": "string"
}
},
"password": {
"source": ['body.password'],
"required": true,
"validation": {
"type": "string"
}
},
"grant_type": {
"source": ['body.grant_type'],
"required": false,
"default": "password",
"validation": {
"type": "string",
"enum": ["password"]
}
}
},
"/refresh/token": {
"_apiInfo": {
"l": "Refresh an access token",
"group": "Guest"
},
"refresh_token": {
"source": ['body.refresh_token'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/pin": {
"_apiInfo": {
"l": "Create an access token with pin",
"group": "Tokenization"
},
"pin": {
"source": ['body.pin'],
"required": false,
"validation": {
"type": "string"
}
},
"grant_type": {
"source": ['body.grant_type'],
"required": false,
"default": "password",
"validation": {
"type": "string",
"enum": ["refresh_token", "password"]
}
},
"refresh_token": {
"source": ['body.refresh_token'],
"required": false,
"validation": {
"type": "string"
}
}
}
},
"delete": {
"/accessToken/:token": {
"_apiInfo": {
"l": "Delete access token",
"group": "Tokenization"
},
"token": {
"source": ['params.token'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/refreshToken/:token": {
"_apiInfo": {
"l": "Delete refresh token",
"group": "Tokenization"
},
"token": {
"source": ['params.token'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/tokens/user/:userId": {
"_apiInfo": {
"l": "Delete all tokens for a given user",
"group": "User Tokenization"
},
"userId": {
"source": ['params.userId'],
"required": true,
"validation": {
"type": "string"
}
}
},
"/tokens/tenant/:clientId": {
"_apiInfo": {
"l": "Delete all tokens for this client (tenant)",
"group": "Cient Tokenization"
},
"clientId": {
"source": ['params.clientId'],
"required": true,
"validation": {
"type": "string"
}
}
}
}
}
};