cidaas-javascript-sdk 2.4.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +9 -20
  2. package/README.md +526 -54
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,24 +1,13 @@
1
- # [2.4.0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v2.3.0...v2.4.0) (2023-03-23)
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
- * add username and email ([eefaa29](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/eefaa296b685be80f10b6a12f4ed0fc99d380cf4))
7
- * Added few changes to readme file. ([ef38f00](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ef38f00e9a734abe77e0553cb528f8836cd4085e))
8
- * added new api in webauth.ts file ([d5f650d](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/d5f650dcc1f0ce93ef0c0adc81c0d78e4769b556))
9
- * added the options for max_age parameter ([f1bb8a2](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/f1bb8a2a9e306b4515160b42786d9a5f401e091c))
10
- * added the options for max_age parameters in SDK method ([209ce9e](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/209ce9e278319f026d1d3da3195341abe407f5fe))
11
- * github sync ([b12d785](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/b12d7857c5d05972340ce27d4ceae72a0b9c0f90))
12
- * option error ([3c79e1d](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/3c79e1d44d71a902d9b3209e13e0a16d4c31071a))
13
- * option error fixed ([1724345](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/1724345045f11c8bedabebbdf433447baf08a8b5))
14
- * push only master to github ([5ddb5b5](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/5ddb5b5408838468ff38bc649777d6d41fcc7e41))
15
- * read me file update for account link ([1f62e22](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/1f62e22f40f3808aaa6566d404f2b5950616c8d7))
16
- * remove manual trigger ([80391c1](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/80391c135b19d15c86012899c784edf664e58fe5))
17
- * skip remote add if exists ([9080176](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/908017679774080c58e77f073c1c8fecd31d7de1))
18
- * sync branch changes ([2ae6213](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/2ae621374c29de663ecfc295610c54f03445e6c6))
19
- * vulnerability fix ([444adb5](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/444adb5249c45e0782d5fb2280a60c5518064a85))
20
-
21
-
22
- ### Features
23
-
24
- * added useraccountLink api for two users and update the readme file ([3eea712](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/3eea7123c435bda2ea59ea5bfff1b0481d204940))
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
- // the response will give you login details.
92
+ // the response will give you login details.
87
93
  }).catch(function(ex) {
88
94
  // your failure code here
89
95
  });
@@ -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
@@ -419,7 +453,74 @@ cidaas.getMissingFields({
419
453
  }).then(function (response) {
420
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
 
@@ -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
 
@@ -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
@@ -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
@@ -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
@@ -605,7 +706,7 @@ cidaas.changePassword({
605
706
  .then(function () {
606
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
 
@@ -633,7 +734,7 @@ cidaas.getProfileInfo({
633
734
  }).then(function (response) {
634
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
- // the response will give you user profile information.
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
 
@@ -744,7 +852,7 @@ cidaas.updateProfile({
744
852
  }, 'your access token', 'your sub').then(function () {
745
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
@@ -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.
@@ -825,7 +1073,7 @@ this.cidaas.setupEmail({
825
1073
  }).then((response) => {
826
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
 
@@ -855,7 +1103,7 @@ this.cidaas.enrollEmail({
855
1103
  }).then((response) => {
856
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
 
@@ -888,7 +1136,7 @@ this.cidaas.initiateEmail({
888
1136
  }).then((response) => {
889
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
 
@@ -920,7 +1168,7 @@ this.cidaas.authenticateEmail({
920
1168
  }).then((response) => {
921
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
 
@@ -980,7 +1228,7 @@ this.cidaas.enrollSMS({
980
1228
  }).then((response) => {
981
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
 
@@ -1013,7 +1261,7 @@ this.cidaas.initiateSMS({
1013
1261
  }).then((response) => {
1014
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
 
@@ -1045,7 +1293,7 @@ this.cidaas.authenticateSMS({
1045
1293
  }).then((response) => {
1046
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
 
@@ -1075,7 +1323,7 @@ this.cidaas.setupIVR({
1075
1323
  }).then((response) => {
1076
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
 
@@ -1105,7 +1353,7 @@ this.cidaas.enrollIVR({
1105
1353
  }).then((response) => {
1106
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
 
@@ -1138,7 +1386,7 @@ this.cidaas.initiateIVR({
1138
1386
  }).then((response) => {
1139
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
 
@@ -1170,7 +1418,7 @@ this.cidaas.authenticateIVR({
1170
1418
  }).then((response) => {
1171
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
 
@@ -1200,7 +1448,7 @@ this.cidaas.setupBackupcode({
1200
1448
  }).then((response) => {
1201
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
 
@@ -1239,7 +1487,7 @@ this.cidaas.initiateBackupcode({
1239
1487
  }).then((response) => {
1240
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
 
@@ -1271,7 +1519,7 @@ this.cidaas.authenticateBackupcode({
1271
1519
  }).then((response) => {
1272
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
 
@@ -1302,7 +1550,7 @@ this.cidaas.setupTOTP({
1302
1550
  }).then((response) => {
1303
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
 
@@ -1332,7 +1580,7 @@ this.cidaas.enrollTOTP({
1332
1580
  }).then((response) => {
1333
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
 
@@ -1365,7 +1613,7 @@ this.cidaas.initiateTOTP({
1365
1613
  }).then((response) => {
1366
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
 
@@ -1397,7 +1645,7 @@ this.cidaas.authenticateTOTP({
1397
1645
  }).then((response) => {
1398
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
 
@@ -1428,7 +1676,7 @@ this.cidaas.setupPattern({
1428
1676
  }).then((response) => {
1429
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
 
@@ -1462,7 +1710,7 @@ this.cidaas.initiatePattern({
1462
1710
  }).then((response) => {
1463
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
 
@@ -1495,7 +1743,7 @@ this.cidaas.setupTouchId({
1495
1743
  }).then((response) => {
1496
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
 
@@ -1529,7 +1777,7 @@ this.cidaas.initiateTouchId({
1529
1777
  }).then((response) => {
1530
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
 
@@ -1562,7 +1810,7 @@ this.cidaas.setupSmartPush({
1562
1810
  }).then((response) => {
1563
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
 
@@ -1585,7 +1833,7 @@ this.cidaas.initiateSmartPush({
1585
1833
  }).then((response) => {
1586
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
 
@@ -1618,7 +1866,7 @@ this.cidaas.setupFace({
1618
1866
  }).then((response) => {
1619
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
 
@@ -1652,7 +1900,7 @@ this.cidaas.initiateFace({
1652
1900
  }).then((response) => {
1653
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
 
@@ -1685,7 +1933,7 @@ this.cidaas.setupVoice({
1685
1933
  }).then((response) => {
1686
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
 
@@ -1719,7 +1967,7 @@ this.cidaas.initiateVoice({
1719
1967
  }).then((response) => {
1720
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.
@@ -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()****
@@ -1798,7 +2078,7 @@ this.cidaas.acceptConsent({
1798
2078
  }).then((response) => {
1799
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()****.
@@ -1840,7 +2135,7 @@ this.cidaas.acceptClaimConsent({
1840
2135
  }).then((response) => {
1841
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
 
@@ -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
@@ -1891,7 +2275,7 @@ this.cidaas.getDeduplicationDetails({
1891
2275
  }).then((response) => {
1892
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
 
@@ -1926,7 +2310,7 @@ this.cidaas.registerDeduplication({
1926
2310
  }).then((response) => {
1927
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
 
@@ -1957,7 +2341,7 @@ this.cidaas.deduplicationLogin({
1957
2341
  }).then((response) => {
1958
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
 
@@ -2099,12 +2483,100 @@ this.socket.on("status-update", (msg) => {
2099
2483
  }
2100
2484
  });
2101
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
+ ```
2102
2574
 
2103
2575
  ## Possible Error
2104
2576
 
2105
2577
  The SDK will throws Custom Exception if something went wrong during the operation:
2106
2578
 
2107
2579
  | HTTP Status Code | When could it be thrown |
2108
- |---|---|
2580
+ |----------------- | ----------------------- |
2109
2581
  | 500 | during creation of WebAuth instance |
2110
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.4.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",