forked from mosip/esignet-signup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
esignet-signup-openapi.yaml
814 lines (803 loc) · 27.1 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
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
openapi: 3.1.0
x-stoplight:
id: t9tvfbteqqokf
info:
title: e-Signet Signup Portal APIs
version: '1.0'
contact:
name: MOSIP Team
email: info@mosip.io
url: 'https://www.mosip.io/'
description: ''
license:
name: MPL-2.0
url: 'https://www.mozilla.org/en-US/MPL/2.0/'
summary: Signup portal for e-Signet one-login system.
servers:
- url: 'https://camdgc-dev.mosip.net/v1/signup'
paths:
/settings:
get:
summary: UI Settings Endpoint
operationId: getdetails
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
response:
type: object
properties:
configs:
$ref: '#/components/schemas/UIConfigMap'
x-stoplight:
id: q1iltvghi3nda
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
errorMessage:
type: string
examples:
Example 1:
value:
responseTime: string
response:
configs:
identifier.pattern: string
identifier.prefix: string
captcha.site.key: string
otp.length: 0
otp.secret: true
password.pattern: string
challenge.timeout: 0
resend.attempts: 0
resend.delay: 0
fullname.pattern: string
status.request.delay: 0
status.request.limit: 0
popup.timeout: 0
identifier.allowed.characters: string
identifier.length.min: 0
identifier.length.max: 0
fullname.allowed.characters: string
fullname.length.min: 0
fullname.length.max: 0
otp.blocked: 0
errors:
- errorCode: string
errorMessage: string
description: |-
Endpoint to get the configurations required by the signup UI.
All these UI configurations should be taken from the configurations.
parameters: []
tags:
- UI
x-stoplight:
id: qi15z7zd0mza1
parameters: []
/registration/generate-challenge:
post:
summary: Generate Challenge Endpoint
operationId: post-send-otp
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
response:
type: object
description: 'If successful otp details, or null if failed to deliver OTP.'
properties:
status:
description: Transaction Identifier.
x-stoplight:
id: fyp7gfgdwq7s1
enum:
- SUCCESS
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
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
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.
requestBody:
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z'''
request:
type: object
required:
- identifier
- captchaToken
- purpose
properties:
identifier:
type: string
x-stoplight:
id: bpjm48g2v7kvq
description: Phone number to which the OTP should be triggered.
captchaToken:
type: string
description: 'Captcha token, if enabled.'
locale:
type: string
x-stoplight:
id: dm6k0lxwgywoi
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
x-stoplight:
id: 2lzyacd68vmbl
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:
x-stoplight:
id: x576z7k9ocx77
enum:
- REGISTRATION
- RESET_PASSWORD
description: Marks the purpose of this challenge in the transaction.
required:
- requestTime
- request
examples:
Example 1:
value:
requestTime: string
request:
identifier: string
captchaToken: string
locale: string
regenerate: true
purpose: REGISTRATION
description: ''
parameters:
- schema:
type: string
in: header
name: X-XSRF-TOKEN
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
tags:
- UI
x-stoplight:
id: vxqpd5jfxa7fw
parameters: []
/registration/verify-challenge:
post:
summary: Challenge Verification Endpoint
operationId: post-verify-challenge
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
response:
type: object
properties:
status:
description: Transaction Identifier.
x-stoplight:
id: b4isdjm5vgn3w
enum:
- SUCCESS
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
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
requestBody:
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z'''
request:
type: object
required:
- identifier
- challengeInfo
properties:
identifier:
type: string
x-stoplight:
id: g9ujmewgchhvx
challengeInfo:
x-stoplight:
id: d7jg9njcc0hsz
type: array
items:
$ref: '#/components/schemas/ChallengeInfo'
x-stoplight:
id: qzu8tg3w7mpdi
required:
- requestTime
- request
examples:
Example 1:
value:
requestTime: string
request:
identifier: string
challengeInfo:
- challenge: string
format: alpha-numeric
type: OTP
description: ''
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.
parameters:
- schema:
type: string
in: header
name: X-XSRF-TOKEN
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
- schema:
type: string
in: cookie
name: TRANSACTION_ID
description: Transaction Id set after successful generate-challenge response
required: true
tags:
- UI
x-stoplight:
id: 5w1jlgm2nd3vi
parameters: []
/registration/register:
post:
summary: Register Endpoint
operationId: post-register
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
response:
type: object
properties:
status:
x-stoplight:
id: pkkk1t229lfzw
enum:
- PENDING
- COMPLETED
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
- invalid_transaction
errorMessage:
type: string
examples:
Example 1:
value:
responseTime: '2023-11-03T11:03:49.770Z'
response:
status: PENDING
errors: []
requestBody:
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z'''
request:
type: object
required:
- username
- password
- consent
- userInfo
properties:
username:
type: string
x-stoplight:
id: 6q8do7w32x0jw
description: Unique identifier to be registered.
password:
type: string
x-stoplight:
id: mr6yhobogq9mr
consent:
type: string
x-stoplight:
id: ebh7zp82o6qpv
userInfo:
$ref: '#/components/schemas/UserInfoMap'
x-stoplight:
id: bw6b8aak6crqa
description: 'This is a map, every key-value here is a field published in the identity-schema.'
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
description: ''
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.
parameters:
- schema:
type: string
in: header
name: X-XSRF-TOKEN
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
- schema:
type: string
in: cookie
name: VERIFIED_TRANSACTION_ID
required: true
description: Transaction Id set after successful verify-challenge response
tags:
- UI
x-stoplight:
id: 2hjdhr5el5njr
parameters: []
/registration/status:
get:
summary: Registration Status Endpoint
operationId: post-register
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
response:
type: object
properties:
status:
enum:
- PENDING
- COMPLETED
- FAILED
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
examples:
Example 1:
value:
responseTime: '2023-11-03T11:03:49.770Z'
response:
status: COMPLETED
errors: []
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.
parameters:
- schema:
type: string
in: header
name: X-XSRF-TOKEN
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
- schema:
type: string
in: cookie
name: VERIFIED_TRANSACTION_ID
required: true
description: Transaction Id set after successful verify-challenge response
tags:
- UI
x-stoplight:
id: f83mjjhr29d8z
parameters: []
/reset-password:
post:
summary: Reset password Endpoint
tags:
- UI
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseTime:
type: string
x-stoplight:
id: oesr14znkgxnw
response:
type: object
x-stoplight:
id: 9gx157knc8xe2
properties:
status:
x-stoplight:
id: f17mmip9h7a5a
enum:
- PENDING
- COMPLETED
errors:
type: array
x-stoplight:
id: hz6for7qtg0y6
items:
x-stoplight:
id: 2l3a666l3hed8
type: object
properties:
errorCode:
x-stoplight:
id: d5ly4w4i5a8aa
enum:
- invalid_transaction
- invalid_identifier
- invalid_password
- invalid_request
- reset_pwd_failed
errorMessage:
type: string
x-stoplight:
id: zqebmmry73gxy
operationId: post-reset-password
x-stoplight:
id: ic8n8i7m96tvl
parameters:
- schema:
type: string
in: header
name: X-XSRF-TOKEN
description: CSRF token as set in cookie key 'XSRF-TOKEN'
required: true
- schema:
type: string
in: cookie
name: VERIFIED_TRANSACTION_ID
description: Transaction Id set after successful verify-challenge response
required: true
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.
requestBody:
content:
application/json:
schema:
type: object
properties:
requestTime:
type: string
x-stoplight:
id: 05a45dp4282wo
pattern: 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z'''
request:
type: object
x-stoplight:
id: mw927li066y7f
required:
- identifier
- password
properties:
identifier:
type: string
x-stoplight:
id: 184hr98bqti3v
password:
type: string
x-stoplight:
id: y75gs4yzdny5v
required:
- requestTime
- request
components:
schemas:
ChallengeInfo:
title: ChallengeInfo
x-stoplight:
id: 1cxfyt0ociff1
type: object
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
description: Format of the challenge provided.
enum:
- alpha-numeric
- base64url-encoded-json
type:
x-stoplight:
id: 5lsvuy0xzgdpz
enum:
- OTP
- KBA
required:
- challenge
- format
- type
UIConfigMap:
title: UIConfigMap
x-stoplight:
id: pk5oh6iydw2yh
type: object
description: Key-value pairs as configured in signup server.
properties:
identifier.pattern:
type: string
x-stoplight:
id: llcziowwj2mfd
identifier.prefix:
type: string
x-stoplight:
id: 47u2d5zweee4d
captcha.site.key:
type: string
x-stoplight:
id: xvn49kydbuquu
otp.length:
type: integer
x-stoplight:
id: fmxu53wvcnn89
otp.secret:
type: boolean
x-stoplight:
id: clq6lawdiv5sw
password.pattern:
type: string
x-stoplight:
id: dsivqz0j2tec3
challenge.timeout:
type: integer
x-stoplight:
id: hl1xr862urmzg
resend.attempts:
type: integer
x-stoplight:
id: ddzr0dfoo7xpf
resend.delay:
type: integer
x-stoplight:
id: 6zqk5k8obbg4k
fullname.pattern:
type: string
x-stoplight:
id: tds566ujtgj31
status.request.delay:
type: integer
x-stoplight:
id: buol713i6pwca
status.request.limit:
type: integer
x-stoplight:
id: 17xix5t5uge6v
popup.timeout:
type: integer
x-stoplight:
id: 6nw3a7652i2mg
identifier.allowed.characters:
type: string
x-stoplight:
id: 29v2qkp06py17
identifier.length.min:
type: integer
x-stoplight:
id: 3hgr9nb7b3fjw
identifier.length.max:
type: integer
x-stoplight:
id: t7obingp65qhb
fullname.allowed.characters:
type: string
x-stoplight:
id: qs19oxiqrmj8j
fullname.length.min:
type: integer
x-stoplight:
id: co1zde4lrl3fm
fullname.length.max:
type: integer
x-stoplight:
id: 1rbn24q5q4bmy
otp.blocked:
type: integer
x-stoplight:
id: vtr8ejovybza2
description: 'Number of seconds, a mobile number will not be allowed to register.'
UserInfoMap:
title: UserInfoMap
x-stoplight:
id: oe9bf8m3cbwss
type: object
properties:
fullName:
type: array
x-stoplight:
id: jnhmr1s98zhfe
items:
$ref: '#/components/schemas/LanguageTaggedValue'
x-stoplight:
id: juwn8o1k46pcp
phone:
type: string
x-stoplight:
id: spbzxvu35010m
preferredLang:
type: string
x-stoplight:
id: zxlxymcghj2wf
required:
- fullName
- phone
LanguageTaggedValue:
title: LanguageTaggedValue
x-stoplight:
id: rgmh1nwfow2b8
type: object
properties:
language:
type: string
x-stoplight:
id: gkxsnfwr3v5ns
value:
type: string
x-stoplight:
id: xigy4a1i683u0
securitySchemes:
Authorization-Bearer:
type: http
scheme: bearer
tags:
- name: UI
description: UI related API.