-
Notifications
You must be signed in to change notification settings - Fork 42
/
esignet-signup-openapi.yaml
749 lines (738 loc) · 26.8 KB
/
esignet-signup-openapi.yaml
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
openapi: 3.1.0
info:
version: '1.0'
title: e-Signet Signup Portal APIs
summary: Signup portal for e-Signet one-login system.
description: Signup portal for e-Signet one-login system.
contact:
name: MOSIP Team
email: [email protected]
url: 'https://www.mosip.io/'
license:
url: 'https://www.mozilla.org/en-US/MPL/2.0/'
name: MPL-2.0
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
paths:
/settings:
get:
tags:
- UI
summary: UI Settings Endpoint
description: |-
Endpoint to get the configurations required by the signup UI.
All these UI configurations should be taken from the configurations.
operationId: get-details
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
description: Current date and time when the request is sent
format: date-time
response:
type: object
properties:
configs:
$ref: '#/components/schemas/UIConfigMap'
description: Its key-value pairs of ui configuration.
errors:
type:
- array
- 'null'
description: List of errors in case of request validation / processing failure in the server.
items:
type: object
properties:
errorCode:
type: string
enum:
- invalid_transaction
- unknown_error
errorMessage:
type: string
enum:
- invalid_transaction
- unknown_error
examples:
Example 1:
value:
responseTime: '2011-10-05T14:48:00.000Z'
response:
configs:
identifier.pattern: '^\\+855[1-9]\\d{7,8}$'
identifier.prefix: '+855'
captcha.site.key: 6LeFAAAAAMaOuSNQxj3VDbERZcyc_1UO_9xT
otp.length: 6
otp.secret: true
password.pattern: '^(?\u003d.*[0-9])(?\u003d.{8,20})[a-zA-Z0-9\\x5F\\W]{8,20}$'
challenge.timeout: 30
resend.attempts: 4
resend.delay: 30
fullname.pattern: '^[\\u1780-\\u17FF\\u19E0-\\u19FF\\u1A00-\\u1A9F\\u0020]{1,30}$'
status.request.delay: 20
status.request.limit: 10
popup.timeout: 50
identifier.allowed.characters: '^[0-9]+'
identifier.length.min: 8
identifier.length.max: 9
fullname.allowed.characters: '^[\\u1780-\\u17FF\\u19E0-\\u19FF\\u1A00-\\u1A9F\\u0020]'
fullname.length.min: 1
fullname.length.max: 30
otp.blocked: 120
errors:
- errorCode: invalid_transaction
errorMessage: invalid_transaction
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
/registration/generate-challenge:
post:
tags:
- UI
summary: Generate Challenge Endpoint
description: |-
Endpoint to generate challenge for the input identifier of the user.
For eg: if the provided identifier is phone number, OTP is sent to phone. If the identifier is email, OTP is mailed to the given emailID.
TransactionId is created and stored in the cache to maintain the state of the challenge specific to input user identifier.
1. Should identify if the provided identifier is phone number or emailID.
2. Response header should set-cookie with transactionId
3. On success, return status as SUCCESS
4. In Failure, response is set to null, errors list if set with specific errorCode.
5. if regenerate is true, then a valid transactionId is excepted in the cookie to re-generate the challenge in the existing transaction.
6. Purpose of the challenge is set on starting of new transaction. Challenge generated for "Registration" should be used only for registration process.
And challenge generated for RESET_PASSWORD should be used only to reset password.
operationId: post-send-otp
parameters:
- name: X-XSRF-TOKEN
in: header
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
schema:
type: string
requestBody:
description: ''
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
description: Current date and time when the request is sent
format: date-time
request:
type: object
properties:
identifier:
type: string
description: A unique Identifier against which a challange can be generated for verification. Ex. Phonenumber
captchaToken:
type: string
description: 'Captcha token, if enabled.'
locale:
type: string
description: |-
Locale to be used to send the challege in the notification to the user.
If not provided default notification language is considered.
regenerate:
type: boolean
description: |-
True - when we should resend the challenge for existing transaction.
False - when a new transaction has to be started.
Default value is False.
purpose:
type: string
enum:
- REGISTRATION
- RESET_PASSWORD
description: Marks the purpose of this challenge in the transaction.
required:
- identifier
- captchaToken
- purpose
required:
- requestTime
- request
examples:
Example 1:
value:
requestTime: '2011-10-05T14:48:00.000Z'
request:
identifier: +8557357xxxxx
captchaToken: asdncjdnsdchd
locale: eng
regenerate: true
purpose: REGISTRATION
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
description: Current date and time when the request is sent
format: date-time
response:
type: object
description: 'If successful otp details, or null if failed to deliver OTP.'
properties:
status:
const: SUCCESS
description: Status of challenge verification.
errors:
type: array
description: List of Errors in case of request validation / processing failure in the server.
items:
type: object
properties:
errorCode:
type: string
enum:
- invalid_transaction
- invalid_otp_channel
- invalid_captcha
- send_otp_failed
- active_otp_found
- unknown_error
errorMessage:
type: string
enum:
- invalid_transaction
- invalid_otp_channel
- invalid_captcha
- send_otp_failed
- active_otp_found
- unknown_error
examples:
Example 1:
value:
responseTime: '2023-11-03T11:03:30.000Z'
response:
status: SUCCESS
errors: []
headers:
set-cookie:
schema:
type: string
example: 'Set-Cookie: TRANSACTION_ID=2GFKHGAEyyx6lEhB4ObBzpPuaTrTlKy3BK0Izl3taug; Max-Age=600; Secure; HttpOnly'
description: Transaction Id is set in the cookie
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
/registration/verify-challenge:
post:
tags:
- UI
summary: Challenge Verification Endpoint
description: |-
Endpoint to verify with the provided challenge w.r.t the transaction ID.
1. TransactionId from the cookie is validated.
2. validate the challenge.
3. identifier in the request MUST match the identifier stored in the cache.
3. On success, return status as SUCCESS
4. In Failure, response is set to null, errors list if set with specific errorCode.
TransactionId and setting the same in the new cookie, post successful challenge verification.
Old cookie is removed by setting age to 0.
operationId: post-verify-challenge
parameters:
- name: X-XSRF-TOKEN
in: header
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
schema:
type: string
- name: TRANSACTION_ID
in: cookie
description: Transaction Id set after successful generate-challenge response
required: true
schema:
type: string
requestBody:
description: ''
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
description: Current date and time when the request is sent
format: date-time
request:
type: object
properties:
identifier:
type: string
description: A unique Identifier against which a challange can be generated for verification. Ex. Phonenumber
challengeInfo:
type: array
description: List of Challenges generated
items:
$ref: '#/components/schemas/ChallengeInfo'
required:
- identifier
- challengeInfo
required:
- requestTime
- request
examples:
Example 1:
value:
requestTime: '2011-10-05T14:48:00.000Z'
request:
identifier: string
challengeInfo:
- challenge: string
format: alpha-numeric
type: OTP
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
description: Current date and time when the request is sent
format: date-time
response:
type: object
properties:
status:
const: SUCCESS
description: Status of challenge verification.
errors:
type: array
description: List of Errors in case of request validation / processing failure in Idp server.
items:
type: object
properties:
errorCode:
type: string
enum:
- invalid_transaction
- challenge_failed
- invalid_challenge_type
- invalid_challenge_format
- unknown_error
- already-registered
errorMessage:
type: string
enum:
- invalid_transaction
- challenge_failed
- invalid_challenge_type
- invalid_challenge_format
- unknown_error
- already-registered
examples:
Example 1:
value:
responseTime: '2023-11-03T11:03:49.770Z'
response:
status: SUCCESS
errors: []
headers:
set-cookie:
schema:
type: string
description: Verified transaction Id to be set after successful challenge verification
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
/registration/register:
post:
tags:
- UI
summary: Register Endpoint
description: |-
Endpoint to register the individual.
1. username is with country code including + symbol if present.
2. if username is phone number, the same should be set as value to "phone" field.
3. Fields with no value should be set to null in userInfo.
Note: We should clearly convey that username contains country code in the UI after registration.
operationId: post-register
parameters:
- name: X-XSRF-TOKEN
in: header
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
schema:
type: string
- name: VERIFIED_TRANSACTION_ID
in: cookie
description: Transaction Id set after successful verify-challenge response
required: true
schema:
type: string
requestBody:
description: ''
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
description: Current date and time when the request is sent
format: date-time
request:
type: object
properties:
username:
type: string
description: Unique identifier to be registered.
password:
type: string
description: Password associated with the username
consent:
type: string
description: Consent to store the user info.
userInfo:
$ref: '#/components/schemas/UserInfoMap'
description: 'This is a map, every key-value here is a field published in the identity-schema.'
required:
- username
- password
- consent
- userInfo
required:
- requestTime
- request
examples:
Example 1:
value:
requestTime: '2023-11-03T11:03:49.770Z'
request:
username: '85534567890'
password: <plain-password>
consent: AGREE
userInfo:
fullName:
- language: khm
value: អានុសា
phone: '+85534567890'
preferredLang: eng
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
description: Current date and time when the request is sent
format: date-time
response:
type: object
properties:
status:
type: string
enum:
- PENDING
- COMPLETED
description: Status of registration
errors:
type: array
description: List of Errors in case of request validation / processing failure in the server.
items:
type: object
properties:
errorCode:
type: string
enum:
- invalid_transaction
- unknown_error
errorMessage:
type: string
enum:
- invalid_transaction
- unknown_error
examples:
Example 1:
value:
responseTime: '2023-11-03T11:03:49.770Z'
response:
status: PENDING
errors: []
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
/registration/status:
get:
tags:
- UI
summary: Registration Status Endpoint
description: |-
Endpoint to get the latest registration/reset-password status.
1. validate the verified_transaction id in the cookie.
2. check status of each handle registered.
3. Once the status of all the registered handles are in end statuses (Completed / Failed). Mark the
transaction as completed.
4. Return back the final status in the response.
operationId: get-registration-status
parameters:
- name: X-XSRF-TOKEN
in: header
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
schema:
type: string
- name: VERIFIED_TRANSACTION_ID
in: cookie
description: Transaction Id set after successful verify-challenge response
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
description: Current date and time when the request is sent
format: date-time
response:
type: object
properties:
status:
type: string
enum:
- PENDING
- COMPLETED
- FAILED
description: Status of registration
errors:
type: array
description: List of Errors in case of request validation / processing failure in the server.
items:
type: object
properties:
errorCode:
type: string
enum:
- invalid_transaction
- unknown_error
errorMessage:
type: string
enum:
- invalid_transaction
- unknown_error
examples:
Example 1:
value:
responseTime: '2023-11-03T11:03:49.770Z'
response:
status: COMPLETED
errors: []
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
/reset-password:
post:
tags:
- UI
summary: Reset password Endpoint
description: |-
Endpoint to reset password for already registered users.
1. TransactionId from the cookie is validated.
2. identifier in the request MUST match the identifier stored in the cache.
3. Retrieve the identity from credential-service using the identifier.
4. Fetch the uin from the retrieved identity and use to call the updateIdentity endpoint.
5. Generate password hash for the provided new password.
6. On success, return status as PENDING
7. In Failure, response is set to null, errors list if set with specific errorCode.
registration/status endpoint should be invoked to get the latest status of the pwd reset.
operationId: post-reset-password
parameters:
- name: X-XSRF-TOKEN
in: header
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
schema:
type: string
- name: VERIFIED_TRANSACTION_ID
in: cookie
description: Transaction Id set after successful verify-challenge response
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
description: Current date and time when the request is sent
format: date-time
request:
type: object
properties:
identifier:
type: string
password:
type: string
required:
- identifier
- password
required:
- requestTime
- request
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
description: Current date and time when the request is sent
format: date-time
response:
type: object
properties:
status:
type: string
enum:
- PENDING
- COMPLETED
errors:
type: array
items:
type: object
properties:
errorCode:
type: string
enum:
- invalid_transaction
- invalid_identifier
- invalid_password
- invalid_request
- reset_pwd_failed
errorMessage:
type: string
enum:
- invalid_transaction
- invalid_identifier
- invalid_password
- invalid_request
- reset_pwd_failed
servers:
- url: 'https://signup.collab.mosip.net/v1/signup'
tags:
- name: UI
description: UI related API.
components:
securitySchemes:
Authorization-Bearer:
type: http
scheme: bearer
schemas:
UIConfigMap:
type: object
title: UIConfigMap
description: Key-value pairs as configured in signup server.
properties:
identifier.pattern:
type: string
identifier.prefix:
type: string
captcha.site.key:
type: string
otp.length:
type: integer
otp.secret:
type: boolean
password.pattern:
type: string
challenge.timeout:
type: integer
resend.attempts:
type: integer
resend.delay:
type: integer
fullname.pattern:
type: string
status.request.delay:
type: integer
status.request.limit:
type: integer
popup.timeout:
type: integer
identifier.allowed.characters:
type: string
identifier.length.min:
type: integer
identifier.length.max:
type: integer
fullname.allowed.characters:
type: string
fullname.length.min:
type: integer
fullname.length.max:
type: integer
otp.blocked:
type: integer
description: 'Number of seconds, a mobile number will not be allowed to register.'
ChallengeInfo:
type: object
title: ChallengeInfo
description: Model to take any type of challenge from the end user as part of challenge verification request.
properties:
challenge:
type: string
description: Actual challenge as string.
format:
type: string
enum:
- alpha-numeric
- base64url-encoded-json
description: Format of the challenge provided.
type:
type: string
enum:
- OTP
- KBA
required:
- challenge
- format
- type
UserInfoMap:
type: object
title: UserInfoMap
properties:
fullName:
type: array
items:
$ref: '#/components/schemas/LanguageTaggedValue'
phone:
type: string
preferredLang:
type: string
required:
- fullName
- phone
LanguageTaggedValue:
type: object
title: LanguageTaggedValue
properties:
language:
type: string
value:
type: string