cidaas-javascript-sdk 2.0.5 → 2.0.6
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/README.md +41 -2
- package/package.json +1 -1
- package/src/main/web-auth/webauth.js +25 -0
package/README.md
CHANGED
|
@@ -16,9 +16,9 @@ This cidaas Javascript SDK library is built on the top of [OIDC client javascrip
|
|
|
16
16
|
From CDN
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
|
-
<!-- Release version 2.0.
|
|
19
|
+
<!-- Release version 2.0.6 -->
|
|
20
20
|
<!-- Minified version -->
|
|
21
|
-
<script src="https://cdn.cidaas.de/javascript/oidc/2.0.
|
|
21
|
+
<script src="https://cdn.cidaas.de/javascript/oidc/2.0.6/cidaas-javascript-sdk.min.js"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
From npm
|
|
@@ -758,7 +758,46 @@ cidaas.logoutUser({
|
|
|
758
758
|
access_token : 'your accessToken'
|
|
759
759
|
});
|
|
760
760
|
```
|
|
761
|
+
#### Delete User Account
|
|
761
762
|
|
|
763
|
+
To delete the user account directly in the application, call **deleteUserAccount()**. This method will delete the user account with **requestId** as the **query parameter**.
|
|
764
|
+
|
|
765
|
+
This method takes an object as input.
|
|
766
|
+
|
|
767
|
+
##### Sample code
|
|
768
|
+
|
|
769
|
+
```js
|
|
770
|
+
options = {
|
|
771
|
+
sub: "7e4f79a9-cfbc-456d-936a-e6bc1de2d4b9",
|
|
772
|
+
requestId: "7d86460b-8288-4341-aed1- 10dd27a4565c",
|
|
773
|
+
accept-language: "en"
|
|
774
|
+
}
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
The usage of the method is as follows.
|
|
778
|
+
|
|
779
|
+
```js
|
|
780
|
+
cidaas.deleteUserAccount(options).then(function (response) {
|
|
781
|
+
|
|
782
|
+
// your success code here
|
|
783
|
+
|
|
784
|
+
}).catch(function(ex) {
|
|
785
|
+
|
|
786
|
+
// your failure code here
|
|
787
|
+
|
|
788
|
+
});
|
|
789
|
+
```
|
|
790
|
+
#### Response
|
|
791
|
+
|
|
792
|
+
```js
|
|
793
|
+
{
|
|
794
|
+
"success": true,
|
|
795
|
+
"status": 200,
|
|
796
|
+
"data": {
|
|
797
|
+
"result": true
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
```
|
|
762
801
|
#### Physical Verification
|
|
763
802
|
|
|
764
803
|
After successful login, we can add multifactor authentications.
|
package/package.json
CHANGED
|
@@ -1077,6 +1077,31 @@ WebAuth.prototype.getScopeConsentDetails = function (options) {
|
|
|
1077
1077
|
});
|
|
1078
1078
|
};
|
|
1079
1079
|
|
|
1080
|
+
// get scope consent version details
|
|
1081
|
+
WebAuth.prototype.getScopeConsentVersionDetailsV2 = function (options) {
|
|
1082
|
+
return new Promise(function (resolve, reject) {
|
|
1083
|
+
try {
|
|
1084
|
+
var http = new XMLHttpRequest();
|
|
1085
|
+
var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/v2/consent/versions/details/" + options.scopeid + "?locale=" + options.locale;
|
|
1086
|
+
http.onreadystatechange = function () {
|
|
1087
|
+
if (http.readyState == 4) {
|
|
1088
|
+
if (http.responseText) {
|
|
1089
|
+
resolve(JSON.parse(http.responseText));
|
|
1090
|
+
} else {
|
|
1091
|
+
resolve(false);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
http.open("GET", _serviceURL, true);
|
|
1096
|
+
http.setRequestHeader("Content-type", "application/json");
|
|
1097
|
+
http.setRequestHeader("Authorization", "Bearer " + options.access_token);
|
|
1098
|
+
http.send();
|
|
1099
|
+
} catch (ex) {
|
|
1100
|
+
reject(ex);
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1080
1105
|
// accept scope Consent
|
|
1081
1106
|
WebAuth.prototype.acceptScopeConsent = function (options) {
|
|
1082
1107
|
var _serviceURL = window.webAuthSettings.authority + "/consent-management-srv/consent/scope/accept";
|