cidaas-javascript-sdk 2.3.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,18 +1,13 @@
1
- # [2.3.0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.2.7...v2.3.0) (2023-03-02)
1
+ ## [2.4.1](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.4.0...v2.4.1) (2023-04-04)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * [813](https://gitlab.widas.de/cidaas-v2/ui/issues/-/issues/813) added headers parameters ([966b149](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/966b1493c93b5ccf80839f2bcff979a541974730))
7
- * [813](https://gitlab.widas.de/cidaas-v2/ui/issues/-/issues/813) added headers parameters ([d085513](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/d085513585770cdae5bc6c8693d10c7f6764faaf))
8
- * [813](https://gitlab.widas.de/cidaas-v2/ui/issues/-/issues/813) added headers parameters ([e103f95](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/e103f956583b727c7e66f32d56a38fac84ab3f02))
9
- * [813](https://gitlab.widas.de/cidaas-v2/ui/issues/-/issues/813) added headers parameters ([a38ac72](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/a38ac7219decd19cd237ec82c6898ca09880218a))
10
- * adapt review changes ([81aec32](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/81aec32ce735fad6955ee7db7c0e8edb80df3059))
11
- * end statement with semicolon ([c924be0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/c924be0a26022db76f5a516e20bf03051b809cc6))
12
- * indentation fix and readme update ([4b1568f](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/4b1568f8068952b93fa43689ac04a8c2bd5a43ca))
13
- * revert long-lat change ([86a35bc](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/86a35bc70d0ffd01b0f3a0acf13d5b0d114590f7))
14
-
15
-
16
- ### Features
17
-
18
- * added the acceptlanguage options in header ([7871bc9](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/7871bc9290ca34e5cf91d0ab00a0ae1905437bc6)), closes [/gitlab.widas.de/customer-specific-projects/integration-team/cidaas-public-devkit-documentation/-/issues/218#note_552348](https://gitlab.widas.de//gitlab.widas.de/customer-specific-projects/integration-team/cidaas-public-devkit-documentation/-/issues/218/issues/note_552348)
6
+ * [#229](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/issues/229) Requirements section added to the Readme ([b93cef4](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/b93cef4971c0b23fd852ad0dfd0485770d2a6306))
7
+ * Added depoy to stage ([ca110af](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ca110afbcfb566d1e2b1c0d9110fc2d544438ea4))
8
+ * Added some changes to gitlab-ci file for aws_upload ([387e20c](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/387e20c25707f09e3e422f7f15b5aea68e779c70))
9
+ * api doc reference linked ([f426f17](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/f426f1761e07b011f76f40be80708bd605a97e1b))
10
+ * bullet point the requirements ([0cc3e9b](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/0cc3e9bdf73f90c386f090ead896cc7d696ee291))
11
+ * missing function added ([489b64d](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/489b64dc802f03df5cea5b25f93596e5daaf1431))
12
+ * Modified the script tag ([e688923](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/e6889239ca72e7354ee78a305a79d52115ba4320))
13
+ * parameter declaration ([ad4d19a](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ad4d19a3105403cc680d472ec332e2bcf7eb994d))
package/README.md CHANGED
@@ -11,6 +11,12 @@
11
11
  ## cidaas-javascript-sdk
12
12
  This cidaas Javascript SDK library is built on the top of [OIDC client javascript library](https://github.com/IdentityModel/oidc-client-js).
13
13
 
14
+ #### Requirements
15
+
16
+ Make sure you have installed all of the following prerequisites on your development machine:
17
+ * Node.js - Download & Install Node.js. The version required is >= 8
18
+ * npm - node package manager to add the package and install dependent packages
19
+
14
20
  #### Installation
15
21
 
16
22
  From CDN
@@ -18,7 +24,7 @@ From CDN
18
24
  ```html
19
25
  <!-- Release version 2.0.9 -->
20
26
  <!-- Minified version -->
21
- <script src="https://cdn.cidaas.de/javascript/oidc/2.0.9/cidaas-javascript-sdk.min.js"></script>
27
+ <script src="https://cdn.cidaas.de/javascript/oidc/2.5.0/cidaas-javascript-sdk.min.js"></script>
22
28
  ```
23
29
 
24
30
  From npm
@@ -83,7 +89,7 @@ To complete the login process, call ****logincallback()****. This will parses th
83
89
 
84
90
  ```js
85
91
  cidaas.loginCallback().then(function(response) {
86
- // your success code here
92
+ // the response will give you login details.
87
93
  }).catch(function(ex) {
88
94
  // your failure code here
89
95
  });
@@ -103,7 +109,7 @@ cidaas.registerWithBrowser();
103
109
  To get the user profile information, call ****getUserInfo()****. This will return the basic user profile details along with groups, roles and whatever scopes you mentioned in the options.
104
110
  ```js
105
111
  cidaas.getUserInfo().then(function (response) {
106
- // your success code here
112
+ // the response will give you profile details.
107
113
  }).catch(function(ex) {
108
114
  // your failure code here
109
115
  });;
@@ -114,7 +120,7 @@ cidaas.getUserInfo().then(function (response) {
114
120
 
115
121
  ```js
116
122
  cidaas.logout().then(function () {
117
- // your success code here
123
+ // your logout success code here
118
124
  }).catch(function(ex) {
119
125
  // your failure code here
120
126
  });
@@ -136,7 +142,7 @@ Each and every proccesses starts with requestId, it is an entry point to login o
136
142
 
137
143
  ```js
138
144
  cidaas.getRequestId().then(function (response) {
139
- // your success code here
145
+ // the response will give you request ID.
140
146
  }).catch(function(ex) {
141
147
  // your failure code here
142
148
  });
@@ -163,7 +169,7 @@ To get the tenant basic information, call ****getTenantInfo()****. This will ret
163
169
  ##### Sample code
164
170
  ```js
165
171
  cidaas.getTenantInfo().then(function (response) {
166
- // your success code here
172
+ // the response will give you tenent details.
167
173
  }).catch(function(ex) {
168
174
  // your failure code here
169
175
  });
@@ -196,7 +202,7 @@ cidaas.getClientInfo({
196
202
  requestId: 'your requestId',
197
203
  acceptlanguage: 'your locale' // optional example: de-de, en-US
198
204
  }).then(function (resp) {
199
- // your success code here
205
+ // the response will give you client info.
200
206
  }).catch(function(ex) {
201
207
  // your failure code here
202
208
  });
@@ -224,7 +230,7 @@ cidaas.getClientInfo({
224
230
 
225
231
  ##### Login with credentials
226
232
 
227
- To login with your credentials, call ****loginWithCredentials()****. After successful login, this will redirect you to the redirect_url that you mentioned earlier while initialising the sdk
233
+ To login with your credentials, call ****loginWithCredentials()****. After successful login, this will redirect you to the redirect_url that you mentioned earlier while initialising the sdk. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/5gphdk6vapp56-classic-login#call-login-api for more detials.
228
234
 
229
235
  ##### Sample code
230
236
  ```js
@@ -236,9 +242,37 @@ cidaas.loginWithCredentials({
236
242
  });
237
243
  ```
238
244
 
245
+ #### Login with credentials and get response
246
+ To login with username and password, call **loginWithCredentialsAsynFn()**. The function accepts a function parameter of type object. In the sample example the object is named as options. Below are the key that need to be passed in the options object
247
+
248
+ | Name | Type | Description | Is optional |
249
+ | ---- | ---- | ----------- | ----------- |
250
+ | request_id | string | request id of the session | false |
251
+ | username | string | the username of the user | false |
252
+ | password | string | password to authenticate the username | false |
253
+
254
+
255
+ ##### Sample code
256
+
257
+ ```js
258
+ options = {
259
+ request_id: "bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
260
+ username: "test@cidaas.de"
261
+ password: "cidaas"
262
+ }
263
+
264
+ cidaas.loginWithCredentialsAsynFn(options)
265
+ .then(function (response) {
266
+ // type your code here
267
+ })
268
+ .catch(function (ex) {
269
+ // your failure code here
270
+ });
271
+ ```
272
+
239
273
  ##### Login with social
240
274
 
241
- To login with social providers, call ****loginWithSocial()****. This will redirect you to the facebook login page.
275
+ To login with social providers, call ****loginWithSocial()****. This will redirect you to the facebook login page. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9mi5uqxhqlsm5-social-login#call-social-login-api for more details
242
276
 
243
277
  ##### Sample code
244
278
  ```js
@@ -258,7 +292,7 @@ cidaas.getRegistrationSetup({
258
292
  requestId: 'your requestId',
259
293
  acceptlanguage: 'your locale' // optional example: de-de, en-US
260
294
  }).then(function (resp) {
261
- // your success code here
295
+ // the response will give you fields that are required.
262
296
  }).catch(function(ex) {
263
297
  // your failure code here
264
298
  });
@@ -365,7 +399,7 @@ cidaas.register({
365
399
  provider: 'your provider', // FACEBOOK, GOOGLE, SELF
366
400
  acceptlanguage: 'your locale' // optional example: de-de, en-US
367
401
  }, headers).then(function (response) {
368
- // type your code here
402
+ // the response will give you client registration details.
369
403
  }).catch(function(ex) {
370
404
  // your failure code here
371
405
  });
@@ -417,9 +451,76 @@ cidaas.getMissingFields({
417
451
  requestId: 'your requestId', // which you will get it from url
418
452
  acceptlanguage: 'your locale' // optional example: de-de, en-US
419
453
  }).then(function (response) {
420
- // type your code here
454
+ // the response will give you user info with missing fields.
421
455
  }).catch(function (ex) {
422
- // your failure code here
456
+ // your failure code here
457
+ });
458
+ ```
459
+
460
+ ##### Progressive Registration
461
+ For progressive registration, call **progressiveRegistration()**. While logging in If the API returns 417 with the error message MissingRequiredFields, call the **getMissingFieldsLogin** to get the list of missing fileds and proceed with progressive registration. In the sample request only the required fields are added, however you must provide the missing fields along with the required fields.
462
+
463
+ ##### Function parameters
464
+ | Name | Type | Description |
465
+ | ---- | ---- | ----------- |
466
+ | options | object | The object with the keys described in the below table under section options |
467
+ | headers | object | The object with the keys described in the below table under section headers |
468
+
469
+ ##### options
470
+
471
+ | Key name | Type | Description | Is optional |
472
+ | ---- | ---- | ----------- | ----------- |
473
+ | acceptlanguage | string | your locale/browser local | true |
474
+
475
+ * Please provide provide the missing fields along with the required fields
476
+
477
+ ##### headers
478
+
479
+ | Key name | Type | Description | Is optional |
480
+ | ---- | ---- | ----------- | ----------- |
481
+ | trackId | string | the track id received while logging in | false |
482
+ | requestId | string | request id of the session | false |
483
+
484
+
485
+ ##### Sample code
486
+
487
+ ```js
488
+ options = {
489
+ acceptlanguage: 'en-Us'
490
+ }
491
+
492
+ headers = {
493
+ trackId: 'bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
494
+ requestId: 'bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
495
+ }
496
+ cidaas.progressiveRegistration(options, headers)
497
+ .then(function (response) {
498
+ // type your code here
499
+ })
500
+ .catch(function (ex) {
501
+ // your failure code here
502
+ })
503
+ ```
504
+
505
+ ##### Get Missing Fields Login
506
+ To get the missing fields after login, call **getMissingFieldsLogin()**.
507
+
508
+ ##### Function parameters
509
+ | Name | Type | Description |
510
+ | ---- | ---- | ----------- |
511
+ | trackId | string | the track id received while logging in |
512
+
513
+
514
+ ##### Sample code
515
+
516
+ ```js
517
+ let trackId = 'bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9';
518
+ cidaas.getMissingFieldsLogin(trackId)
519
+ .then(function (response) {
520
+ // type your code here
521
+ })
522
+ .catch(function (ex) {
523
+ // your failure code here
423
524
  });
424
525
  ```
425
526
 
@@ -436,7 +537,7 @@ cidaas.getCommunicationStatus({
436
537
  sub: 'your sub', // which you will get on the registration response
437
538
  acceptlanguage: 'your locale' // optional example: de-de, en-US
438
539
  }).then(function (response) {
439
- // type your code here
540
+ // the response will give you account details once its verified.
440
541
  }).catch(function(ex) {
441
542
  // your failure code here
442
543
  });
@@ -467,7 +568,7 @@ cidaas.initiateAccountVerification({
467
568
  processingType: 'CODE',
468
569
  sub: 'your sub'
469
570
  }).then(function (response) {
470
- // type your code here
571
+ // the response will give you account verification details.
471
572
  }).catch(function(ex) {
472
573
  // your failure code here
473
574
  });
@@ -494,7 +595,7 @@ cidaas.verifyAccount({
494
595
  accvid: 'your accvid', // which you will get on initiate account verification response
495
596
  code: 'your code in email or sms or ivr'
496
597
  }).then(function (response) {
497
- // type your code here
598
+ // the response will give you account verification ID and unique code.
498
599
  }).catch(function(ex) {
499
600
  // your failure code here
500
601
  });
@@ -504,7 +605,7 @@ cidaas.verifyAccount({
504
605
 
505
606
  ##### Initiate Reset Password
506
607
 
507
- To initiate the password resetting, call ****initiateResetPassword()****. This will send verification code to your email or mobile based on the resetMedium you mentioned.
608
+ To initiate the password resetting, call ****initiateResetPassword()****. This will send verification code to your email or mobile based on the resetMedium you mentioned. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/6b29bac6002f4-initiate-password-reset for more details.
508
609
 
509
610
  ##### Sample code
510
611
 
@@ -515,7 +616,7 @@ cidaas.initiateResetPassword({
515
616
  requestId: 'your requestId',
516
617
  resetMedium: 'email'
517
618
  }).then(function (response) {
518
- // type your code here
619
+ // the response will give you password reset details.
519
620
  }).catch(function(ex) {
520
621
  // your failure code here
521
622
  });
@@ -535,7 +636,7 @@ cidaas.initiateResetPassword({
535
636
 
536
637
  ##### Handle Reset Password
537
638
 
538
- To handling the reset password by entering the verification code you received, call ****handleResetPassword()****. This will check your verification code was valid or not and allows you to proceed to the next step
639
+ To handling the reset password by entering the verification code you received, call ****handleResetPassword()****. This will check your verification code was valid or not and allows you to proceed to the next step. More details available on https://docs.cidaas.com/docs/cidaas-iam/4aede115e5460-validate-reset-password
539
640
 
540
641
  ##### Sample code
541
642
  ```js
@@ -543,7 +644,7 @@ cidaas.handleResetPassword({
543
644
  code: 'your code in email or sms or ivr',
544
645
  resetRequestId: 'your resetRequestId' // which you will get on initiate reset password response
545
646
  }).then(function (response) {
546
- // type your code here
647
+ // the response will give you valid verification code.
547
648
  }).catch(function(ex) {
548
649
  // your failure code here
549
650
  });
@@ -563,7 +664,7 @@ cidaas.handleResetPassword({
563
664
 
564
665
  ##### Reset Password
565
666
 
566
- To change the password, call ****resetPassword()****. This will allow you to change your password.
667
+ To change the password, call ****resetPassword()****. This will allow you to change your password. More detials available on https://docs.cidaas.com/docs/cidaas-iam/c7d767a7414df-accept-reset-password
567
668
 
568
669
  ##### Sample code
569
670
  ```js
@@ -573,7 +674,7 @@ cidaas.resetPassword({
573
674
  exchangeId: 'your exchangeId', // which you will get on handle reset password response
574
675
  resetRequestId: 'your resetRequestId' // which you will get on handle reset password response
575
676
  }).then(function (response) {
576
- // type your code here
677
+ // the response will give you reset password details.
577
678
  }).catch(function(ex) {
578
679
  // your failure code here
579
680
  });
@@ -592,7 +693,7 @@ cidaas.resetPassword({
592
693
 
593
694
  ##### Change Password
594
695
 
595
- To change the password, call ****changePassword()****. This will allow you to change your password.
696
+ To change the password, call ****changePassword()****. This will allow you to change your password. More details available on https://docs.cidaas.com/docs/cidaas-iam/09873c57d1fb8-change-password
596
697
 
597
698
  ##### Sample code
598
699
  ```js
@@ -603,9 +704,9 @@ cidaas.changePassword({
603
704
  identityId: 'asdauet1-quwyteuqqwejh-asdjhasd',
604
705
  }, 'your access token')
605
706
  .then(function () {
606
- // type your code here
707
+ // the response will give you changed password.
607
708
  }).catch(function (ex) {
608
- // your failure code here
709
+ // your failure code here
609
710
  });
610
711
  ```
611
712
 
@@ -631,9 +732,9 @@ cidaas.getProfileInfo({
631
732
  access_token: 'your access token',
632
733
  acceptlanguage: 'your locale' // optional example: de-de, en-US
633
734
  }).then(function (response) {
634
- // type your code here
735
+ // the response will give you user profile details.
635
736
  }).catch(function (ex) {
636
- // your failure code here
737
+ // your failure code here
637
738
  });
638
739
  ```
639
740
 
@@ -698,17 +799,24 @@ cidaas.getProfileInfo({
698
799
 
699
800
  #### Getting user profile
700
801
 
701
- To get the user profile information, call ****getUserProfile()****.
802
+ To get the user profile information, call ****getUserProfile()****. The function accepts a function parameter of type object. In the sample example the object is named as options. Below are the key that need to be passed in the options object
803
+
804
+ | Key name | Type | Description | Is optional |
805
+ | ---- | ---- | ----------- | ----------- |
806
+ | access_token | string | a bearer token | false |
807
+ | acceptlanguage | string | browser/custom local | true |
702
808
 
703
809
  ##### Sample code
704
810
  ```js
705
- cidaas.getUserProfile({
706
- access_token: 'your access token',
707
- acceptlanguage: 'your locale' // optional example: de-de, en-US
708
- }).then(function (response) {
709
- // type your code here
811
+ let options = {
812
+ access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
813
+ acceptlanguage: 'en-US'
814
+ }
815
+ cidaas.getUserProfile(options)
816
+ .then(function (response) {
817
+ // the response will give you user profile information.
710
818
  }).catch(function (ex) {
711
- // your failure code here
819
+ // your failure code here
712
820
  });
713
821
  ```
714
822
 
@@ -742,9 +850,9 @@ cidaas.updateProfile({
742
850
  provider: 'self',
743
851
  acceptlanguage: 'your locale' // optional example: de-de, en-US
744
852
  }, 'your access token', 'your sub').then(function () {
745
- // type your code here
853
+ // the response will give you updated user profile info.
746
854
  }).catch(function (ex) {
747
- // your failure code here
855
+ // your failure code here
748
856
  });
749
857
  ```
750
858
 
@@ -762,7 +870,7 @@ To logout the user, call ****logoutUser()****.
762
870
  ##### Sample code
763
871
  ```js
764
872
  cidaas.logoutUser({
765
- access_token : 'your accessToken'
873
+ access_token : 'your accessToken'
766
874
  });
767
875
  ```
768
876
  #### Delete User Account
@@ -787,7 +895,7 @@ The usage of the method is as follows.
787
895
  ```js
788
896
  cidaas.deleteUserAccount(options).then(function (response) {
789
897
 
790
- // your success code here
898
+ // the response will give you account details to be deleted.
791
899
 
792
900
  }).catch(function(ex) {
793
901
 
@@ -806,6 +914,146 @@ cidaas.deleteUserAccount(options).then(function (response) {
806
914
  }
807
915
  }
808
916
  ```
917
+
918
+ ##### User Check Exists
919
+ Check if user exists, call **userCheckExists()**. The function accepts a function parameter of type object. The object with the keys described in the below table
920
+
921
+ | Key name | Type | Description | Is optional |
922
+ | ---- | ---- | ----------- | ----------- |
923
+ | requestId | string | the request id of a session | false |
924
+
925
+ ##### Sample code
926
+
927
+ ```js
928
+ options = {
929
+ requestId : "bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
930
+ }
931
+ cidaas.userCheckExists(options)
932
+ .then(function(response) {
933
+ // type your code here
934
+ })
935
+ .catch(function(ex) {
936
+ // your failure code here
937
+ });
938
+ ```
939
+
940
+
941
+ ##### Initiate account linking
942
+ To initiate account linking, call **initiateLinkAccount()**. The function parameters are mentioned below.
943
+
944
+ ##### Function parameters
945
+ | Name | Type | Description | Is optional |
946
+ | ---- | ---- | ----------- | ----------- |
947
+ | options | object | an object with the keys described in the below table | false |
948
+ | access_token | string | the username of the user | false |
949
+
950
+
951
+ | Key name | Type | Description | Is optional |
952
+ | ---- | ---- | ----------- | ----------- |
953
+ | user_name_to_link | string | Username that needs to be linked | false |
954
+ | master_sub | string | Master sub to link account | false |
955
+
956
+
957
+ ##### Sample code
958
+
959
+ ```js
960
+ let options = {
961
+ master_sub : "vaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ",
962
+ user_name_to_link: "CidaasTest"
963
+ }
964
+ const acccess_token= "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
965
+
966
+ cidaas.initiateLinkAccount(options,access_token)
967
+ .then(function (response) {
968
+ // type your code here
969
+ })
970
+ .catch(function (ex) {
971
+ // your failure code here
972
+ });
973
+ ```
974
+
975
+ ##### Complete link account
976
+ To complete account linking, call **completeLinkAccount()**. The function parameters are mentioned below.
977
+
978
+ ##### Function parameters
979
+ | Name | Type | Description | Is optional |
980
+ | ---- | ---- | ----------- | ----------- |
981
+ | options | object | an object with the keys described in the below table | false |
982
+ | access_token | string | the username of the user | false |
983
+
984
+
985
+ | Key name | Type | Description | Is optional |
986
+ | ---- | ---- | ----------- | ----------- |
987
+ | link_request_id | string | the request id of account link request | false |
988
+ | code | string | the code received while account linking | false |
989
+
990
+ ##### Sample code
991
+
992
+ ```js
993
+ let options = {
994
+ link_request_id : "vaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ",
995
+ code: "1234567890"
996
+ }
997
+ const acccess_token= "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
998
+
999
+ cidaas.completeLinkAccount(options,access_token)
1000
+ .then(function (response) {
1001
+ // type your code here
1002
+ })
1003
+ .catch(function (ex) {
1004
+ // your failure code here
1005
+ });
1006
+ ```
1007
+
1008
+ ##### Get Linked Users
1009
+ To get all the linked social accounts, call **getLinkedUsers()**. The function accepts the below parameters
1010
+
1011
+ ##### Function parameters
1012
+ | Name | Type | Description | Is optional |
1013
+ | ---- | ---- | ----------- | ----------- |
1014
+ | sub | string | the sub of the user | false |
1015
+ | access_token | string | the username of the user | false |
1016
+
1017
+
1018
+ ##### Sample code
1019
+
1020
+ ```js
1021
+ const sub = "vaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ";
1022
+ const acccess_token= "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
1023
+
1024
+ cidaas.getLinkedUsers(access_token, sub)
1025
+ .then(function (response) {
1026
+ // type your code here
1027
+ })
1028
+ .catch(function (ex) {
1029
+ // your failure code here
1030
+ });
1031
+ ```
1032
+
1033
+ ##### Unlink Account
1034
+ To unlink an social account for a user, call **unlinkAccount()**. The function accepts the below parameters
1035
+
1036
+ ##### Function parameters
1037
+ | Name | Type | Description | Is optional |
1038
+ | ---- | ---- | ----------- | ----------- |
1039
+ | identityId | string | The identity id of the account to be unlinked | false |
1040
+ | access_token | string | the username of the user | false |
1041
+
1042
+ ##### Sample code
1043
+
1044
+ ```js
1045
+ const identityId = "vaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ";
1046
+ const acccess_token= "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
1047
+
1048
+ cidaas.unlinkAccount(access_token, identityId)
1049
+ .then(function (response) {
1050
+ // type your code here
1051
+ })
1052
+ .catch(function (ex) {
1053
+ // your failure code here
1054
+ });
1055
+ ```
1056
+
809
1057
  #### Physical Verification
810
1058
 
811
1059
  After successful login, we can add multifactor authentications.
@@ -823,9 +1071,9 @@ this.cidaas.setupEmail({
823
1071
  deviceId: 'your device id'
824
1072
  }
825
1073
  }).then((response) => {
826
- // type your code here
1074
+ // the response will give you details for email setup.
827
1075
  }).catch((err) => {
828
- // your failure code here
1076
+ // your failure code here
829
1077
  });
830
1078
  ```
831
1079
 
@@ -853,9 +1101,9 @@ this.cidaas.enrollEmail({
853
1101
  deviceId: 'your device id'
854
1102
  }
855
1103
  }).then((response) => {
856
- // type your code here
1104
+ // the response will give you email and device info to be linked.
857
1105
  }).catch((err) => {
858
- // your failure code here
1106
+ // your failure code here
859
1107
  });
860
1108
  ```
861
1109
 
@@ -886,9 +1134,9 @@ this.cidaas.initiateEmail({
886
1134
  deviceId: 'your device id'
887
1135
  }
888
1136
  }).then((response) => {
889
- // type your code here
1137
+ // the response will give you email verification code details.
890
1138
  }).catch((err) => {
891
- // your failure code here
1139
+ // your failure code here
892
1140
  });
893
1141
  ```
894
1142
 
@@ -918,9 +1166,9 @@ this.cidaas.authenticateEmail({
918
1166
  deviceId: 'your device id'
919
1167
  }
920
1168
  }).then((response) => {
921
- // type your code here
1169
+ // the response will give you email authentication details.
922
1170
  }).catch((err) => {
923
- // your failure code here
1171
+ // your failure code here
924
1172
  });
925
1173
  ```
926
1174
 
@@ -948,7 +1196,7 @@ this.cidaas.setupSMS({
948
1196
  deviceId: 'your device id'
949
1197
  }
950
1198
  }).then((response) => {
951
- // type your code here
1199
+ // the response will give you details for SMS setup.
952
1200
  }).catch((err) => {
953
1201
  // your failure code here
954
1202
  });
@@ -978,9 +1226,9 @@ this.cidaas.enrollSMS({
978
1226
  deviceId: 'your device id'
979
1227
  }
980
1228
  }).then((response) => {
981
- // type your code here
1229
+ // the response will give you SMS and device info to be linked
982
1230
  }).catch((err) => {
983
- // your failure code here
1231
+ // your failure code here
984
1232
  });
985
1233
  ```
986
1234
 
@@ -1011,9 +1259,9 @@ this.cidaas.initiateSMS({
1011
1259
  deviceId: 'your device id'
1012
1260
  }
1013
1261
  }).then((response) => {
1014
- // type your code here
1262
+ // the response will give you SMS verification code details.
1015
1263
  }).catch((err) => {
1016
- // your failure code here
1264
+ // your failure code here
1017
1265
  });
1018
1266
  ```
1019
1267
 
@@ -1043,9 +1291,9 @@ this.cidaas.authenticateSMS({
1043
1291
  deviceId: 'your device id'
1044
1292
  }
1045
1293
  }).then((response) => {
1046
- // type your code here
1294
+ // the response will give you SMS authentiction details.
1047
1295
  }).catch((err) => {
1048
- // your failure code here
1296
+ // your failure code here
1049
1297
  });
1050
1298
  ```
1051
1299
 
@@ -1073,9 +1321,9 @@ this.cidaas.setupIVR({
1073
1321
  deviceId: 'your device id'
1074
1322
  }
1075
1323
  }).then((response) => {
1076
- // type your code here
1324
+ // the response will give you details for IVR setup.
1077
1325
  }).catch((err) => {
1078
- // your failure code here
1326
+ // your failure code here
1079
1327
  });
1080
1328
  ```
1081
1329
 
@@ -1103,9 +1351,9 @@ this.cidaas.enrollIVR({
1103
1351
  deviceId: 'your device id'
1104
1352
  }
1105
1353
  }).then((response) => {
1106
- // type your code here
1354
+ // the response will give you IVR and device info to be linked.
1107
1355
  }).catch((err) => {
1108
- // your failure code here
1356
+ // your failure code here
1109
1357
  });
1110
1358
  ```
1111
1359
 
@@ -1136,9 +1384,9 @@ this.cidaas.initiateIVR({
1136
1384
  deviceId: 'your device id'
1137
1385
  }
1138
1386
  }).then((response) => {
1139
- // type your code here
1387
+ // the response will give you IVR verification code details.
1140
1388
  }).catch((err) => {
1141
- // your failure code here
1389
+ // your failure code here
1142
1390
  });
1143
1391
  ```
1144
1392
 
@@ -1168,9 +1416,9 @@ this.cidaas.authenticateIVR({
1168
1416
  deviceId: 'your device id'
1169
1417
  }
1170
1418
  }).then((response) => {
1171
- // type your code here
1419
+ // the response will give you IVR authentication details.
1172
1420
  }).catch((err) => {
1173
- // your failure code here
1421
+ // your failure code here
1174
1422
  });
1175
1423
  ```
1176
1424
 
@@ -1198,9 +1446,9 @@ this.cidaas.setupBackupcode({
1198
1446
  deviceId: 'your device id'
1199
1447
  }
1200
1448
  }).then((response) => {
1201
- // type your code here
1449
+ // the response will give you details for backup-code setup.
1202
1450
  }).catch((err) => {
1203
- // your failure code here
1451
+ // your failure code here
1204
1452
  });
1205
1453
  ```
1206
1454
 
@@ -1237,9 +1485,9 @@ this.cidaas.initiateBackupcode({
1237
1485
  deviceId: 'your device id'
1238
1486
  }
1239
1487
  }).then((response) => {
1240
- // type your code here
1488
+ // the response will give you backup-code verification code details.
1241
1489
  }).catch((err) => {
1242
- // your failure code here
1490
+ // your failure code here
1243
1491
  });
1244
1492
  ```
1245
1493
 
@@ -1269,9 +1517,9 @@ this.cidaas.authenticateBackupcode({
1269
1517
  deviceId: 'your device id'
1270
1518
  }
1271
1519
  }).then((response) => {
1272
- // type your code here
1520
+ // the response will give you backup-code authentication details.
1273
1521
  }).catch((err) => {
1274
- // your failure code here
1522
+ // your failure code here
1275
1523
  });
1276
1524
  ```
1277
1525
 
@@ -1300,9 +1548,9 @@ this.cidaas.setupTOTP({
1300
1548
  deviceId: 'your device id'
1301
1549
  }
1302
1550
  }).then((response) => {
1303
- // type your code here
1551
+ // the response will give you details for TOTP setup.
1304
1552
  }).catch((err) => {
1305
- // your failure code here
1553
+ // your failure code here
1306
1554
  });
1307
1555
  ```
1308
1556
 
@@ -1330,9 +1578,9 @@ this.cidaas.enrollTOTP({
1330
1578
  deviceId: 'your device id'
1331
1579
  }
1332
1580
  }).then((response) => {
1333
- // type your code here
1581
+ // the response will give you TOTP and device info to be linked.
1334
1582
  }).catch((err) => {
1335
- // your failure code here
1583
+ // your failure code here
1336
1584
  });
1337
1585
  ```
1338
1586
 
@@ -1363,9 +1611,9 @@ this.cidaas.initiateTOTP({
1363
1611
  deviceId: 'your device id'
1364
1612
  }
1365
1613
  }).then((response) => {
1366
- // type your code here
1614
+ // the response will give you TOTP verification details.
1367
1615
  }).catch((err) => {
1368
- // your failure code here
1616
+ // your failure code here
1369
1617
  });
1370
1618
  ```
1371
1619
 
@@ -1395,9 +1643,9 @@ this.cidaas.authenticateTOTP({
1395
1643
  deviceId: 'your device id'
1396
1644
  }
1397
1645
  }).then((response) => {
1398
- // type your code here
1646
+ // the response will give you TOTP authentication details.
1399
1647
  }).catch((err) => {
1400
- // your failure code here
1648
+ // your failure code here
1401
1649
  });
1402
1650
  ```
1403
1651
 
@@ -1426,9 +1674,9 @@ this.cidaas.setupPattern({
1426
1674
  deviceId: 'your device id'
1427
1675
  }
1428
1676
  }).then((response) => {
1429
- // type your code here
1677
+ // the response will give you details for Pattern setup.
1430
1678
  }).catch((err) => {
1431
- // your failure code here
1679
+ // your failure code here
1432
1680
  });
1433
1681
  ```
1434
1682
 
@@ -1460,9 +1708,9 @@ this.cidaas.initiatePattern({
1460
1708
  deviceId: 'your device id'
1461
1709
  }
1462
1710
  }).then((response) => {
1463
- // type your code here
1711
+ // the response will give you Pattern verification details.
1464
1712
  }).catch((err) => {
1465
- // your failure code here
1713
+ // your failure code here
1466
1714
  });
1467
1715
  ```
1468
1716
 
@@ -1493,9 +1741,9 @@ this.cidaas.setupTouchId({
1493
1741
  deviceId: 'your device id'
1494
1742
  }
1495
1743
  }).then((response) => {
1496
- // type your code here
1744
+ // the response will give you details for Touch ID setup.
1497
1745
  }).catch((err) => {
1498
- // your failure code here
1746
+ // your failure code here
1499
1747
  });
1500
1748
  ```
1501
1749
 
@@ -1527,9 +1775,9 @@ this.cidaas.initiateTouchId({
1527
1775
  deviceId: 'your device id'
1528
1776
  }
1529
1777
  }).then((response) => {
1530
- // type your code here
1778
+ // the response will give you Touch ID verification details.
1531
1779
  }).catch((err) => {
1532
- // your failure code here
1780
+ // your failure code here
1533
1781
  });
1534
1782
  ```
1535
1783
 
@@ -1560,9 +1808,9 @@ this.cidaas.setupSmartPush({
1560
1808
  deviceId: 'your device id'
1561
1809
  }
1562
1810
  }).then((response) => {
1563
- // type your code here
1811
+ // the response will give you details for Smart Push setup.
1564
1812
  }).catch((err) => {
1565
- // your failure code here
1813
+ // your failure code here
1566
1814
  });
1567
1815
  ```
1568
1816
 
@@ -1583,9 +1831,9 @@ this.cidaas.initiateSmartPush({
1583
1831
  deviceId: 'your device id'
1584
1832
  }
1585
1833
  }).then((response) => {
1586
- // type your code here
1834
+ // the response will give you Smart Push verification details.
1587
1835
  }).catch((err) => {
1588
- // your failure code here
1836
+ // your failure code here
1589
1837
  });
1590
1838
  ```
1591
1839
 
@@ -1616,9 +1864,9 @@ this.cidaas.setupFace({
1616
1864
  deviceId: 'your device id'
1617
1865
  }
1618
1866
  }).then((response) => {
1619
- // type your code here
1867
+ // the response will give you details for Face setup.
1620
1868
  }).catch((err) => {
1621
- // your failure code here
1869
+ // your failure code here
1622
1870
  });
1623
1871
  ```
1624
1872
 
@@ -1650,9 +1898,9 @@ this.cidaas.initiateFace({
1650
1898
  deviceId: 'your device id'
1651
1899
  }
1652
1900
  }).then((response) => {
1653
- // type your code here
1901
+ // the response will give you Face verification details.
1654
1902
  }).catch((err) => {
1655
- // your failure code here
1903
+ // your failure code here
1656
1904
  });
1657
1905
  ```
1658
1906
 
@@ -1683,9 +1931,9 @@ this.cidaas.setupVoice({
1683
1931
  deviceId: 'your device id'
1684
1932
  }
1685
1933
  }).then((response) => {
1686
- // type your code here
1934
+ // the response will give you details for Voice setup.
1687
1935
  }).catch((err) => {
1688
- // your failure code here
1936
+ // your failure code here
1689
1937
  });
1690
1938
  ```
1691
1939
 
@@ -1717,9 +1965,9 @@ this.cidaas.initiateVoice({
1717
1965
  deviceId: 'your device id'
1718
1966
  }
1719
1967
  }).then((response) => {
1720
- // type your code here
1968
+ // the response will give you Voice verification details.
1721
1969
  }).catch((err) => {
1722
- // your failure code here
1970
+ // your failure code here
1723
1971
  });
1724
1972
  ```
1725
1973
 
@@ -1751,6 +1999,22 @@ this.cidaas.mfaContinue({
1751
1999
  ```
1752
2000
 
1753
2001
 
2002
+ ##### Get All Verification List
2003
+ List all verification type configured, call **getAllVerificationList()**. access_token must be passed as function paramere.
2004
+
2005
+ ##### Sample code
2006
+ ```js
2007
+ const access_token = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjEwMjM2ZWZiLWRlMjEtNDI5Mi04Z.";
2008
+
2009
+ cidaas.getAllVerificationList(access_token)
2010
+ .then(function (response) {
2011
+ // type your code here
2012
+ })
2013
+ .catch(function (ex) {
2014
+ // your failure code here
2015
+ });
2016
+ ```
2017
+
1754
2018
  #### Consent Management
1755
2019
 
1756
2020
  For the first time login, the user needs to accept the terms and conditions.
@@ -1765,7 +2029,7 @@ this.cidaas.getConsentDetails({
1765
2029
  consent_name: 'your consent name',
1766
2030
  acceptlanguage: 'your locale' // optional example: de-de, en-US
1767
2031
  }).then((response) => {
1768
- // type your code here
2032
+ // the response will give you details of consent.
1769
2033
  }).catch((err) => {
1770
2034
  // your failure code here
1771
2035
  });
@@ -1784,6 +2048,22 @@ this.cidaas.getConsentDetails({
1784
2048
  }
1785
2049
  ```
1786
2050
 
2051
+
2052
+ ##### Get Consent Details V2
2053
+ To get consent details , call **getConsentDetailsV2()**. The function accepts a parameter of type object. The options paramter in the sample must contain the keys mentioned in in the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info
2054
+
2055
+ ##### Sample code
2056
+
2057
+ ```js
2058
+ cidaas.getConsentDetailsV2(options)
2059
+ .then(function (response) {
2060
+ // type your code here
2061
+ })
2062
+ .catch(function (ex) {
2063
+ // your failure code here
2064
+ });
2065
+ ```
2066
+
1787
2067
  ##### Accept consent
1788
2068
 
1789
2069
  To accept consent, call ****acceptConsent()****
@@ -1796,9 +2076,9 @@ this.cidaas.acceptConsent({
1796
2076
  client_id: 'your client id',
1797
2077
  accepted: true
1798
2078
  }).then((response) => {
1799
- // type your code here
2079
+ // the response will give you details of accepted consent.
1800
2080
  }).catch((err) => {
1801
- // your failure code here
2081
+ // your failure code here
1802
2082
  });
1803
2083
  ```
1804
2084
 
@@ -1813,6 +2093,21 @@ this.cidaas.acceptConsent({
1813
2093
  }
1814
2094
  ```
1815
2095
 
2096
+ ##### Accept Consent V2
2097
+ To accept consent, call **acceptConsentV2()**. The function accepts a parameter of type object. The options paramter in the sample must contain the keys mentioned in in the api document https://docs.cidaas.com/docs/cidaas-iam/0caa9bacdd29e-accept-consent
2098
+
2099
+ ##### Sample code
2100
+
2101
+ ```js
2102
+ cidaas.acceptConsentV2(options)
2103
+ .then(function (response) {
2104
+ // type your code here
2105
+ })
2106
+ .catch(function (ex) {
2107
+ // your failure code here
2108
+ });
2109
+ ```
2110
+
1816
2111
  ##### Consent Continue
1817
2112
 
1818
2113
  To continue after Consent acceptance, call ****consentContinue()****.
@@ -1838,9 +2133,9 @@ this.cidaas.acceptClaimConsent({
1838
2133
  client_id: 'your client id',
1839
2134
  accepted: "accepted claims with array eg: []"
1840
2135
  }).then((response) => {
1841
- // type your code here
2136
+ // the response will give you accepted claim consent.
1842
2137
  }).catch((err) => {
1843
- // your failure code here
2138
+ // your failure code here
1844
2139
  });
1845
2140
  ```
1846
2141
 
@@ -1863,7 +2158,7 @@ this.cidaas.revokeClaimConsent({
1863
2158
  sub: 'your sub',
1864
2159
  revoked_claims: "revoked claims with array eg: []"
1865
2160
  }).then((response) => {
1866
- // type your code here
2161
+ // the response will give you revoked claim consent.
1867
2162
  }).catch((err) => {
1868
2163
  // your failure code here
1869
2164
  });
@@ -1877,6 +2172,95 @@ this.cidaas.revokeClaimConsent({
1877
2172
  "data": true
1878
2173
  }
1879
2174
  ```
2175
+
2176
+ ##### Get Scope Consent Details
2177
+ To get scope consent details, call **getScopeConsentDetails()**. The function accepts a parameter of type object. The options paramter in the sample must contain the keys mentioned in the below table.The function calls the api available in the document https://docs.cidaas.com/docs/cidaas-iam/f4b1bee4c3313-pre-login-check. Please refer to the api document for more details
2178
+
2179
+ | Key name | Type | Description | Is optional |
2180
+ | ---- | ---- | ----------- | ----------- |
2181
+ | track_id | string | the track id recieved while logging in | false |
2182
+ | locale | string | browser accept language or custom language | false |
2183
+
2184
+ ##### Sample code
2185
+
2186
+ ```js
2187
+ let options = {
2188
+ track_id: "5f5cbb84-4ceb-4975-b347-4bfac61e9248",
2189
+ locale: "en-US"
2190
+ }
2191
+
2192
+ cidaas.getScopeConsentDetails(options)
2193
+ .then(function (response) {
2194
+ // type your code here
2195
+ })
2196
+ .catch(function (ex) {
2197
+ // your failure code here
2198
+ });
2199
+ ```
2200
+
2201
+ ##### Get Scope Consent Version Details V2
2202
+ To get scope consent version detials V2, call **getScopeConsentVersionDetailsV2()**. The function accepts a parameter of type object. The options paramter in the sample must contain the keys mentioned in the below table.The function calls the api available in the document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details. Please refer to the api document for more details.
2203
+
2204
+ | Key name | Type | Description | Is optional |
2205
+ | ---- | ---- | ----------- | ----------- |
2206
+ | scopeid | string | the consent id(please refer to api document mentioned above) | false |
2207
+ | locale | string | browser accept language or custom language | false |
2208
+
2209
+ ##### Sample code
2210
+
2211
+ ```js
2212
+ let options = {
2213
+ scopeid: "5f5cbb84-4ceb-4975-b347-4bfac61e9248",
2214
+ locale: "en-US"
2215
+ }
2216
+
2217
+ cidaas.getScopeConsentVersionDestailsV(options)
2218
+ .then(function (response) {
2219
+ // type your code here
2220
+ })
2221
+ .catch(function (ex) {
2222
+ // your failure code here
2223
+ });
2224
+ ```
2225
+
2226
+ ##### Accept Scope Consent
2227
+ To accept scope consent, call **acceptScopeConsent()**. The options paramter in the sample must contain the keys mentioned in in the api document https://docs.cidaas.com/docs/cidaas-iam/84c69a098c5c7-accept-scope-consent. Please refer to the api document for more details.
2228
+
2229
+ ##### Sample code
2230
+
2231
+ ```js
2232
+ cidaas
2233
+ .acceptScopeConsent(options)
2234
+ .then(function (response) {
2235
+ // type your code here
2236
+ })
2237
+ .catch(function (ex) {
2238
+ // your failure code here
2239
+ });
2240
+ ```
2241
+
2242
+ ##### Scope Consent Continue Login
2243
+ To scope consent continue login, call **scopeConsentContinue()**. The function accepts a parameter of type object. The options paramter in the sample must contain the keys mentioned in the below table.The function calls the api available in the document https://docs.cidaas.com/docs/cidaas-iam/aa32097970c52-continue-authentication-flow-after-prechecks. Please refer to the api document for more details.
2244
+
2245
+ | Key name | Type | Description | Is optional |
2246
+ | ---- | ---- | ----------- | ----------- |
2247
+ | track_id | string | track id recieved while loggine in| false |
2248
+
2249
+ ##### Sample code
2250
+
2251
+ ```js
2252
+ let options = {
2253
+ track_id: "5f5cbb84-4ceb-4975-b347-4bfac61e9248"
2254
+ }
2255
+ cidaas.scopeConsentContinue(options)
2256
+ .then(function (response) {
2257
+ // type your code here
2258
+ })
2259
+ .catch(function (ex) {
2260
+ // your failure code here
2261
+ });
2262
+ ```
2263
+
1880
2264
  #### Deduplication
1881
2265
 
1882
2266
  ##### Get deduplication details
@@ -1889,9 +2273,9 @@ this.cidaas.getDeduplicationDetails({
1889
2273
  track_id: 'your track id',
1890
2274
  acceptlanguage: 'your locale' // optional example: de-de, en-US
1891
2275
  }).then((response) => {
1892
- // type your code here
2276
+ // the response will give you deduplication details of users.
1893
2277
  }).catch((err) => {
1894
- // your failure code here
2278
+ // your failure code here
1895
2279
  });
1896
2280
  ```
1897
2281
 
@@ -1924,9 +2308,9 @@ this.cidaas.registerDeduplication({
1924
2308
  track_id: 'your track id',
1925
2309
  acceptlanguage: 'your locale' // optional example: de-de, en-US
1926
2310
  }).then((response) => {
1927
- // type your code here
2311
+ // the response will give you new registered deduplication user.
1928
2312
  }).catch((err) => {
1929
- // your failure code here
2313
+ // your failure code here
1930
2314
  });
1931
2315
  ```
1932
2316
 
@@ -1955,9 +2339,9 @@ this.cidaas.deduplicationLogin({
1955
2339
  requestId: 'your request id',
1956
2340
  password: 'your password'
1957
2341
  }).then((response) => {
1958
- // type your code here
2342
+ // the response will give you deduplication login details.
1959
2343
  }).catch((err) => {
1960
- // your failure code here
2344
+ // your failure code here
1961
2345
  });
1962
2346
  ```
1963
2347
 
@@ -1976,6 +2360,40 @@ this.cidaas.deduplicationLogin({
1976
2360
  }
1977
2361
  }
1978
2362
  ```
2363
+
2364
+ ##### Initiate Users Link
2365
+
2366
+ To initiate a new user link, call ****userAccountLink()****.
2367
+
2368
+ ##### Sample code
2369
+
2370
+ ```js
2371
+ var options = {
2372
+ sub: 'sub of the user who initiates the user link',
2373
+ username: 'username of the user which should get linked',
2374
+ redirect_uri: 'redirect uri the user should get redirected after successful account linking'
2375
+ }
2376
+ ```
2377
+
2378
+ ```js
2379
+ this.cidaas.userAccountLink(options, access_token).then((response) => {
2380
+ // the response will give you that both user are linked.
2381
+ }).catch((err) => {
2382
+ // your failure code here
2383
+ });
2384
+ ```
2385
+
2386
+ ##### Response
2387
+ ```json
2388
+ {
2389
+ "success":true,
2390
+ "status":200,
2391
+ "data": {
2392
+ "redirectUri": "string"
2393
+ }
2394
+ }
2395
+ ```
2396
+
1979
2397
  #### Socket Connection
1980
2398
 
1981
2399
  ##### Installation
@@ -2065,3 +2483,100 @@ this.socket.on("status-update", (msg) => {
2065
2483
  }
2066
2484
  });
2067
2485
  ```
2486
+ #### Access Token
2487
+
2488
+ ##### Get aceess token
2489
+ To get a new token with th grant type authorization_code, call **getAccessToken()**. The function accepts a function parameter of type object. The object with the keys described in the below table
2490
+
2491
+ | Key name | Type | Description | Is optional |
2492
+ | ---- | ---- | ----------- | ----------- |
2493
+ | code | string | code to create a new token | false |
2494
+
2495
+ ##### Sample code
2496
+
2497
+ ```js
2498
+ options = {
2499
+ code: "123456",
2500
+ }
2501
+
2502
+ cidaas.getAccessToken(options)
2503
+ .then(function (response) {
2504
+ // type your code here
2505
+ })
2506
+ .catch(function (ex) {
2507
+ // your failure code here
2508
+ });
2509
+ ```
2510
+
2511
+ ##### Validate access token
2512
+ To validate an access token, call **validateAccessToken()**. The function accepts a function parameter of type object. The object with the keys described in the below table.
2513
+
2514
+ | Key name | Type | Description | Is optional |
2515
+ | ---- | ---- | ----------- | ----------- |
2516
+ | token | string | access token | false |
2517
+ | token_type_hint | string | token type hint. accepted token type hints are access_token, id_token, refresh_token, sso | false |
2518
+
2519
+
2520
+ ##### Sample code
2521
+
2522
+ ```js
2523
+ options = {
2524
+ token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
2525
+ token_type_hint: "access_token",
2526
+ }
2527
+
2528
+ cidaas.validateAccessToken(options)
2529
+ .then(function (response) {
2530
+ // type your code here
2531
+ })
2532
+ .catch(function (ex) {
2533
+ // your failure code here
2534
+ });
2535
+ ```
2536
+
2537
+ ##### Renew token
2538
+ To get a new token with the grant type refresh_token, call **renewToken()**. The function accepts a function parameter of type object. The object with the keys described in the below table
2539
+
2540
+ | Key Name | Type | Description | Is optional |
2541
+ | ---- | ---- | ----------- | ----------- |
2542
+ | refresh_token | string | The refresh token to create a new token. The refresh token is received while creating an access token using the token endpoint and later can be used to fetch a new token without using credentials | false |
2543
+
2544
+ ##### Sample code
2545
+
2546
+ ```js
2547
+ options = {
2548
+ refresh_token: "bGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
2549
+ }
2550
+
2551
+ cidaas.renewToken(options)
2552
+ .then(function (response) {
2553
+ // type your code here
2554
+ })
2555
+ .catch(function (ex) {
2556
+ // your failure code here
2557
+ });
2558
+ ```
2559
+ #### Device
2560
+ ##### Get Device Info
2561
+ To get the device information, call **getDeviceInfo()**
2562
+
2563
+ ##### Sample code
2564
+
2565
+ ```js
2566
+ cidaas.getDeviceInfo()
2567
+ .then(function (response) {
2568
+ // type your code here
2569
+ })
2570
+ .catch(function (ex) {
2571
+ // your failure code here
2572
+ });
2573
+ ```
2574
+
2575
+ ## Possible Error
2576
+
2577
+ The SDK will throws Custom Exception if something went wrong during the operation:
2578
+
2579
+ | HTTP Status Code | When could it be thrown |
2580
+ |----------------- | ----------------------- |
2581
+ | 500 | during creation of WebAuth instance |
2582
+ | 417 | if there are any other failure |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cidaas-javascript-sdk",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "author": "cidaas by Widas ID GmbH",
5
5
  "description": "Cidaas native javascript sdk",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "jest": "27.3.1",
38
38
  "terser-webpack-plugin": "^5.2.4",
39
39
  "typescript": "^4.5.4",
40
- "webpack": "^5.59.1",
40
+ "webpack": "^5.76.2",
41
41
  "webpack-cli": "^4.9.1",
42
42
  "webpack-dev-server": "^4.3.1",
43
43
  "webpack-hot-middleware": "^2.25.1",
@@ -307,7 +307,7 @@ WebAuth.prototype.base64URL = function (string) {
307
307
  };
308
308
 
309
309
  // get login url
310
- WebAuth.prototype.getLoginURL = function () {
310
+ WebAuth.prototype.getLoginURL = function (options = {}) {
311
311
  var settings = window.webAuthSettings;
312
312
  if (!settings.response_type) {
313
313
  settings.response_type = "code";
@@ -328,6 +328,9 @@ WebAuth.prototype.getLoginURL = function () {
328
328
  loginURL += "&response_mode=" + settings.response_mode;
329
329
  }
330
330
  loginURL += "&scope=" + settings.scope;
331
+ if(options && options.max_age){
332
+ loginURL += "&max_age=" + options.max_age;
333
+ }
331
334
  console.log(loginURL);
332
335
  return loginURL;
333
336
  };
@@ -1446,7 +1449,7 @@ WebAuth.prototype.getUnreviewedDevices = function (access_token, sub) {
1446
1449
  }
1447
1450
  };
1448
1451
  http.open("GET", _serviceURL, true);
1449
- http = createHeaders(http, options);
1452
+ http = createHeaders(http, null);
1450
1453
  http.setRequestHeader("Authorization", `Bearer ${access_token}`);
1451
1454
 
1452
1455
  http.send();
@@ -1472,7 +1475,7 @@ WebAuth.prototype.getReviewedDevices = function (access_token, sub) {
1472
1475
  }
1473
1476
  };
1474
1477
  http.open("GET", _serviceURL, true);
1475
- http = createHeaders(http, options);
1478
+ http = createHeaders(http, null);
1476
1479
  http.setRequestHeader("Authorization", `Bearer ${access_token}`);
1477
1480
  http.send();
1478
1481
  } catch (ex) {
@@ -1768,7 +1771,7 @@ WebAuth.prototype.getMissingFieldsLogin = function (trackId) {
1768
1771
  }
1769
1772
  };
1770
1773
  http.open("GET", _serviceURL, true);
1771
- http = createHeaders(http, options);
1774
+ http = createHeaders(http, null);
1772
1775
  http.send();
1773
1776
  } catch (ex) {
1774
1777
  reject(ex);
@@ -1887,4 +1890,10 @@ WebAuth.prototype.getDeviceInfo = function () {
1887
1890
  });
1888
1891
  };
1889
1892
 
1893
+ // initiates a new user link to link two existing users
1894
+ WebAuth.prototype.userAccountLink = function (options, access_token) {
1895
+ var _serviceURL = window.webAuthSettings.authority + "/useractions-srv/users/" + options.sub + "/link";
1896
+ return createPostPromise(options, _serviceURL, false, access_token);
1897
+ };
1898
+
1890
1899
  module.exports = WebAuth;
@@ -15,7 +15,7 @@ declare class WebAuth {
15
15
  generateRandomString(length: any): string;
16
16
  generateCodeChallenge(code_verifier: any): any;
17
17
  base64URL(string: any): any;
18
- getLoginURL(): string;
18
+ getLoginURL(options?: {}): string;
19
19
  getAccessToken(options: any): Promise<any>;
20
20
  validateAccessToken(options: any): Promise<any>;
21
21
  getRequestId(): Promise<any>;
@@ -27,6 +27,8 @@ declare class WebAuth {
27
27
  getTenantInfo(): Promise<any>;
28
28
  logoutUser(options: any): void;
29
29
  getClientInfo(options: any): Promise<any>;
30
+ getDevicesInfo(options: any): Promise<any>;
31
+ deleteDevice(options: any): Promise<any>;
30
32
  getRegistrationSetup(options: any): Promise<any>;
31
33
  register(options: any, headers: any): Promise<any>;
32
34
  getInviteUserDetails(options: any): Promise<any>;
@@ -134,5 +136,6 @@ declare class WebAuth {
134
136
  deviceCodeVerify(code: any): void;
135
137
  userCheckExists(options: any): Promise<any>;
136
138
  setAcceptLanguageHeader(acceptLanguage: any): void;
137
- getDeviceInfo(options: any): Promise<any>;
139
+ getDeviceInfo(): Promise<any>;
140
+ userAccountLink(options: any, access_token: any): Promise<any>;
138
141
  }