cidaas-javascript-sdk 4.3.3 → 5.0.0
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 +52 -5
- package/README.md +109 -93
- package/dist/authentication-service/AuthenticationService.d.ts +140 -0
- package/dist/authentication-service/AuthenticationService.js +210 -0
- package/dist/{authentication/Authentication.model.d.ts → authentication-service/AuthenticationService.model.d.ts} +18 -12
- package/dist/{authentication/Authentication.model.js → authentication-service/AuthenticationService.model.js} +2 -2
- package/dist/common/Common.model.d.ts +15 -19
- package/dist/common/Common.model.js +17 -17
- package/dist/common/ConfigUserProvider.d.ts +10 -0
- package/dist/common/ConfigUserProvider.js +28 -0
- package/dist/common/Helper.d.ts +7 -0
- package/dist/common/Helper.js +19 -0
- package/dist/common/User.model.d.ts +0 -4
- package/dist/consent-service/ConsentService.d.ts +99 -95
- package/dist/consent-service/ConsentService.js +125 -122
- package/dist/consent-service/ConsentService.model.d.ts +14 -16
- package/dist/device-service/DeviceService.d.ts +49 -0
- package/dist/device-service/DeviceService.js +79 -0
- package/dist/device-service/DeviceService.model.d.ts +6 -0
- package/dist/id-validation-service/IdValidationService.d.ts +28 -0
- package/dist/id-validation-service/IdValidationService.js +59 -0
- package/dist/id-validation-service/IdValidationService.model.d.ts +8 -0
- package/dist/id-validation-service/IdValidationService.model.js +2 -0
- package/dist/index.d.ts +22 -3
- package/dist/index.js +35 -18
- package/dist/login-service/LoginService.d.ts +143 -141
- package/dist/login-service/LoginService.js +225 -234
- package/dist/login-service/LoginService.model.d.ts +7 -51
- package/dist/login-service/LoginService.model.js +1 -1
- package/dist/public-service/PublicService.d.ts +57 -0
- package/dist/public-service/PublicService.js +73 -0
- package/dist/public-service/PublicService.model.d.ts +20 -0
- package/dist/public-service/PublicService.model.js +2 -0
- package/dist/token-service/TokenService.d.ts +104 -138
- package/dist/token-service/TokenService.js +164 -219
- package/dist/token-service/TokenService.model.d.ts +3 -44
- package/dist/token-service/TokenService.model.js +3 -16
- package/dist/user-service/UserService.d.ts +381 -315
- package/dist/user-service/UserService.js +552 -426
- package/dist/user-service/UserService.model.d.ts +48 -14
- package/dist/user-service/UserService.model.js +4 -4
- package/dist/verification-service/VerificationService.d.ts +281 -223
- package/dist/verification-service/VerificationService.js +343 -287
- package/dist/verification-service/VerificationService.model.d.ts +4 -5
- package/package.json +6 -4
- package/dist/authentication/Authentication.d.ts +0 -139
- package/dist/authentication/Authentication.js +0 -186
- package/dist/web-auth/WebAuth.d.ts +0 -665
- package/dist/web-auth/WebAuth.js +0 -955
- package/dist/web-auth/webauth.model.d.ts +0 -66
- /package/dist/{web-auth/webauth.model.js → device-service/DeviceService.model.js} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceService = void 0;
|
|
4
|
+
const Helper_1 = require("../common/Helper");
|
|
5
|
+
class DeviceService {
|
|
6
|
+
constructor(configUserProvider) {
|
|
7
|
+
this.config = configUserProvider.getConfig();
|
|
8
|
+
this.userManager = configUserProvider.getUserManager();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* To get all devices information associated to the client, call **getDevicesInfo()**
|
|
12
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a2feed70303c-get-device-by-user for more details.
|
|
13
|
+
* @example
|
|
14
|
+
* ```js
|
|
15
|
+
* cidaasDeviceService.getDevicesInfo().then(function (resp) {
|
|
16
|
+
* // the response will give you devices informations.
|
|
17
|
+
* }).catch(function(ex) {
|
|
18
|
+
* // your failure code here
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
getDevicesInfo(access_token) {
|
|
23
|
+
const _serviceURL = this.config.authority + "/device-srv/devices";
|
|
24
|
+
if (access_token) {
|
|
25
|
+
return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", access_token);
|
|
26
|
+
}
|
|
27
|
+
return Helper_1.Helper.getAccessTokenFromUserStorage(this.userManager).then((accessToken) => {
|
|
28
|
+
return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", accessToken);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* To delete device associated to the client, call **deleteDevice()**
|
|
33
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3d44ad903d6e8-logout-the-user-for-a-device for more details.
|
|
34
|
+
* @example
|
|
35
|
+
* ```js
|
|
36
|
+
* const options = {
|
|
37
|
+
* device_id: 'id of device associated to the client.' // call **getDevicesInfo()** to get List of device ids and its details.
|
|
38
|
+
* };
|
|
39
|
+
* cidaasDeviceService.deleteDevice(options).then(function (resp) {
|
|
40
|
+
* // your success code
|
|
41
|
+
* }).catch(function(ex) {
|
|
42
|
+
* // your failure code
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
deleteDevice(options, access_token) {
|
|
47
|
+
const _serviceURL = this.config.authority + "/device-srv/device/" + options.device_id;
|
|
48
|
+
const payload = window.navigator.userAgent ? Object.assign(Object.assign({}, options), { userAgent: window.navigator.userAgent }) : undefined;
|
|
49
|
+
if (access_token) {
|
|
50
|
+
return Helper_1.Helper.createHttpPromise(payload, _serviceURL, false, "DELETE", access_token);
|
|
51
|
+
}
|
|
52
|
+
return Helper_1.Helper.getAccessTokenFromUserStorage(this.userManager).then((accessToken) => {
|
|
53
|
+
return Helper_1.Helper.createHttpPromise(payload, _serviceURL, false, "DELETE", accessToken);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* to generate device info, call **createDeviceInfo()**.
|
|
58
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9b5a892afaf0b-create-device-info for more details.
|
|
59
|
+
* @example
|
|
60
|
+
* ```js
|
|
61
|
+
* cidaasDeviceService.createDeviceInfo().then(function (resp) {
|
|
62
|
+
* // your success code
|
|
63
|
+
* }).catch(function(ex) {
|
|
64
|
+
* // your failure code
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
createDeviceInfo() {
|
|
69
|
+
const value = ('; ' + document.cookie).split(`; cidaas_dr=`).pop().split(';')[0];
|
|
70
|
+
if (!value) {
|
|
71
|
+
const options = {
|
|
72
|
+
userAgent: window.navigator.userAgent
|
|
73
|
+
};
|
|
74
|
+
const serviceURL = this.config.authority + '/device-srv/deviceinfo';
|
|
75
|
+
return Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.DeviceService = DeviceService;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ConfigUserProvider from "../common/ConfigUserProvider";
|
|
2
|
+
import { InvokeIdValidationCaseRequest } from "./IdValidationService.model";
|
|
3
|
+
export declare class IdValidationService {
|
|
4
|
+
private config;
|
|
5
|
+
private userManager;
|
|
6
|
+
constructor(configUserProvider: ConfigUserProvider);
|
|
7
|
+
/**
|
|
8
|
+
* To invoke a new id validation case, call invokeIdValidationCase().
|
|
9
|
+
* Make sure that the access token, which is used to call this api (either as parameter or from user storage)
|
|
10
|
+
* have the following scopes: cidaas:idval_init cidaas:idval_perform cidaas:idval_settings_read profile
|
|
11
|
+
*
|
|
12
|
+
* @param options payload to be sent to the api
|
|
13
|
+
* @param access_token will either be given as function parameter or will be fetch from user storage if not given
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```js
|
|
17
|
+
* import { IdValidationService } from 'cidaas-javascript-sdk';
|
|
18
|
+
*
|
|
19
|
+
* const options = {
|
|
20
|
+
* redirect_url: 'your redirect uri',
|
|
21
|
+
* validation_settings_id: 'validation settings id from admin ui'
|
|
22
|
+
* };
|
|
23
|
+
*
|
|
24
|
+
* cidaasIdValidationService.invokeIdValidationCase(options);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
invokeIdValidationCase(options: InvokeIdValidationCaseRequest, access_token?: string): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdValidationService = void 0;
|
|
4
|
+
const Helper_1 = require("../common/Helper");
|
|
5
|
+
class IdValidationService {
|
|
6
|
+
constructor(configUserProvider) {
|
|
7
|
+
this.config = configUserProvider.getConfig();
|
|
8
|
+
this.userManager = configUserProvider.getUserManager();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* To invoke a new id validation case, call invokeIdValidationCase().
|
|
12
|
+
* Make sure that the access token, which is used to call this api (either as parameter or from user storage)
|
|
13
|
+
* have the following scopes: cidaas:idval_init cidaas:idval_perform cidaas:idval_settings_read profile
|
|
14
|
+
*
|
|
15
|
+
* @param options payload to be sent to the api
|
|
16
|
+
* @param access_token will either be given as function parameter or will be fetch from user storage if not given
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```js
|
|
20
|
+
* import { IdValidationService } from 'cidaas-javascript-sdk';
|
|
21
|
+
*
|
|
22
|
+
* const options = {
|
|
23
|
+
* redirect_url: 'your redirect uri',
|
|
24
|
+
* validation_settings_id: 'validation settings id from admin ui'
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* cidaasIdValidationService.invokeIdValidationCase(options);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
invokeIdValidationCase(options, access_token) {
|
|
31
|
+
const serviceURL = this.config.authority + '/idval-sign-srv/caseinvocation';
|
|
32
|
+
if (access_token) {
|
|
33
|
+
callIdValidationAPI(options, serviceURL, access_token);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
Helper_1.Helper.getAccessTokenFromUserStorage(this.userManager).then((accessToken) => {
|
|
37
|
+
callIdValidationAPI(options, serviceURL, accessToken);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.IdValidationService = IdValidationService;
|
|
42
|
+
/**
|
|
43
|
+
* API call and response handling of id validation case invocation. This function will be called internally by invokeIdValidationCase() function.
|
|
44
|
+
*
|
|
45
|
+
* @param options payload to be sent to the api
|
|
46
|
+
* @param serviceURL will be provided by invokeIdValidationCase() function
|
|
47
|
+
* @param access_token comes from either invokeIdValidationCase() function parameter or from user storage
|
|
48
|
+
*/
|
|
49
|
+
function callIdValidationAPI(options, serviceURL, access_token) {
|
|
50
|
+
Helper_1.Helper.createHttpPromise(options, serviceURL, false, 'POST', access_token).then(response => {
|
|
51
|
+
if ((response === null || response === void 0 ? void 0 : response.success) && response.data) {
|
|
52
|
+
const redirectUrl = response.data.case_redirect_url;
|
|
53
|
+
window.location.href = redirectUrl;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.info(`${response.error_code}: ${response.error}`);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface InvokeIdValidationCaseRequest {
|
|
2
|
+
/** URL to the destination where the user will be redirected to after finishing the cidaas ID Validation process */
|
|
3
|
+
redirect_url: string;
|
|
4
|
+
/** UUID of the cidaas ID Validator setting that shall be used for this case. The value can be fetch from Cidaas Admin UI */
|
|
5
|
+
validation_settings_id: string;
|
|
6
|
+
/** String that can be used to identify a finished case */
|
|
7
|
+
external_reference?: string;
|
|
8
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import ConfigUserProvider from "./common/ConfigUserProvider";
|
|
2
|
+
import { AuthenticationService } from "./authentication-service/AuthenticationService";
|
|
3
|
+
import { OidcSettings, OidcManager, LoginRequest, LoginRequestOptions, LoginRedirectOptions, LogoutResponse, LogoutRedirectOptions, PopupSignInOptions, PopupSignOutOptions, RenewTokenOptions, User } from "./authentication-service/AuthenticationService.model";
|
|
4
|
+
import { ConsentService } from "./consent-service/ConsentService";
|
|
5
|
+
import { GetConsentDetailsRequest, AcceptConsentRequest, GetConsentVersionDetailsRequest, AcceptScopeConsentRequest, AcceptClaimConsentRequest, RevokeClaimConsentRequest } from "./consent-service/ConsentService.model";
|
|
6
|
+
import { DeviceService } from "./device-service/DeviceService";
|
|
7
|
+
import { DeleteDeviceRequest } from "./device-service/DeviceService.model";
|
|
8
|
+
import { IdValidationService } from "./id-validation-service/IdValidationService";
|
|
9
|
+
import { InvokeIdValidationCaseRequest } from "./id-validation-service/IdValidationService.model";
|
|
10
|
+
import { LoginService } from "./login-service/LoginService";
|
|
11
|
+
import { LoginWithCredentialsRequest, UsernameType, SocialProviderPathParameter, SocialProviderQueryParameter, PasswordlessLoginRequest, FirstTimeChangePasswordRequest, ProgressiveRegistrationHeader, LoginAfterRegisterRequest } from "./login-service/LoginService.model";
|
|
12
|
+
import { PublicService } from "./public-service/PublicService";
|
|
13
|
+
import { GetClientInfoRequest, GetRequestIdRequest } from "./public-service/PublicService.model";
|
|
14
|
+
import { TokenService } from "./token-service/TokenService";
|
|
15
|
+
import { TokenHeader, TokenClaim, Group, Consent, GrantType, GenerateTokenFromCodeRequest, TokenTypeHint, GroupAllowed } from "./token-service/TokenService.model";
|
|
16
|
+
import { UserService } from "./user-service/UserService";
|
|
17
|
+
import { GetUserProfileRequest, GetRegistrationSetupRequest, RegisterRequest, GetInviteUserDetailsRequest, GetCommunicationStatusRequest, InitiateResetPasswordRequest, HandleResetPasswordRequest, ResetPasswordRequest, GetDeduplicationDetailsRequest, RegisterDeduplicationRequest, DeduplicationLoginRequest, ChangePasswordRequest, InitiateLinkAccountRequest, DeleteUserAccountRequest, CompleteLinkAccountRequest, UserCheckExistsRequest, GetUserActivitiesRequest, UserActionOnEnrollmentRequest, UpdateProfileImageRequest, DateFilter, ResetMedium } from "./user-service/UserService.model";
|
|
18
|
+
import { VerificationService } from "./verification-service/VerificationService";
|
|
19
|
+
import { InitiateAccountVerificationRequest, VerifyAccountRequest, GetMFAListRequest, CancelMFARequest, InitiateEnrollmentRequest, EnrollVerificationRequest, CheckVerificationTypeConfiguredRequest, InitiateMFARequest, AuthenticateMFARequest, DeviceInfo, Location, FIDO2EnrollEntity, InitiateVerificationRequest, ConfigureVerificationRequest, ConfigureFriendlyNameRequest } from "./verification-service/VerificationService.model";
|
|
20
|
+
import { LoginPrecheckRequest, VerificationType, HTTPRequestHeader, ProcessingType } from "./common/Common.model";
|
|
21
|
+
import { CidaasUser, UserAddress, UserMobile, UserGroupMap } from "./common/User.model";
|
|
22
|
+
export { ConfigUserProvider, AuthenticationService, OidcSettings, OidcManager, LoginRequest, LoginRequestOptions, LoginRedirectOptions, LogoutResponse, LogoutRedirectOptions, PopupSignInOptions, PopupSignOutOptions, RenewTokenOptions, User, ConsentService, GetConsentDetailsRequest, AcceptConsentRequest, GetConsentVersionDetailsRequest, AcceptScopeConsentRequest, AcceptClaimConsentRequest, RevokeClaimConsentRequest, DeviceService, DeleteDeviceRequest, IdValidationService, InvokeIdValidationCaseRequest, LoginService, LoginWithCredentialsRequest, UsernameType, SocialProviderPathParameter, SocialProviderQueryParameter, PasswordlessLoginRequest, FirstTimeChangePasswordRequest, ProgressiveRegistrationHeader, LoginAfterRegisterRequest, PublicService, GetClientInfoRequest, GetRequestIdRequest, TokenService, TokenHeader, TokenClaim, Group, Consent, GrantType, GenerateTokenFromCodeRequest, TokenTypeHint, GroupAllowed, UserService, GetUserProfileRequest, GetRegistrationSetupRequest, RegisterRequest, GetInviteUserDetailsRequest, GetCommunicationStatusRequest, InitiateResetPasswordRequest, HandleResetPasswordRequest, ResetPasswordRequest, GetDeduplicationDetailsRequest, RegisterDeduplicationRequest, DeduplicationLoginRequest, ChangePasswordRequest, InitiateLinkAccountRequest, DeleteUserAccountRequest, CompleteLinkAccountRequest, UserCheckExistsRequest, GetUserActivitiesRequest, UserActionOnEnrollmentRequest, UpdateProfileImageRequest, DateFilter, ResetMedium, VerificationService, InitiateAccountVerificationRequest, VerifyAccountRequest, GetMFAListRequest, CancelMFARequest, InitiateEnrollmentRequest, EnrollVerificationRequest, CheckVerificationTypeConfiguredRequest, InitiateMFARequest, AuthenticateMFARequest, DeviceInfo, Location, FIDO2EnrollEntity, InitiateVerificationRequest, ConfigureVerificationRequest, ConfigureFriendlyNameRequest, LoginPrecheckRequest, VerificationType, HTTPRequestHeader, ProcessingType, CidaasUser, UserAddress, UserMobile, UserGroupMap };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
exports.ProcessingType = exports.VerificationType = exports.VerificationService = exports.ResetMedium = exports.UserService = exports.GroupAllowed = exports.TokenTypeHint = exports.GrantType = exports.TokenService = exports.PublicService = exports.UsernameType = exports.LoginService = exports.IdValidationService = exports.DeviceService = exports.ConsentService = exports.User = exports.OidcManager = exports.AuthenticationService = exports.ConfigUserProvider = void 0;
|
|
4
|
+
const ConfigUserProvider_1 = require("./common/ConfigUserProvider");
|
|
5
|
+
exports.ConfigUserProvider = ConfigUserProvider_1.default;
|
|
6
|
+
const AuthenticationService_1 = require("./authentication-service/AuthenticationService");
|
|
7
|
+
Object.defineProperty(exports, "AuthenticationService", { enumerable: true, get: function () { return AuthenticationService_1.AuthenticationService; } });
|
|
8
|
+
const AuthenticationService_model_1 = require("./authentication-service/AuthenticationService.model");
|
|
9
|
+
Object.defineProperty(exports, "OidcManager", { enumerable: true, get: function () { return AuthenticationService_model_1.OidcManager; } });
|
|
10
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return AuthenticationService_model_1.User; } });
|
|
11
|
+
const ConsentService_1 = require("./consent-service/ConsentService");
|
|
12
|
+
Object.defineProperty(exports, "ConsentService", { enumerable: true, get: function () { return ConsentService_1.ConsentService; } });
|
|
13
|
+
const DeviceService_1 = require("./device-service/DeviceService");
|
|
14
|
+
Object.defineProperty(exports, "DeviceService", { enumerable: true, get: function () { return DeviceService_1.DeviceService; } });
|
|
15
|
+
const IdValidationService_1 = require("./id-validation-service/IdValidationService");
|
|
16
|
+
Object.defineProperty(exports, "IdValidationService", { enumerable: true, get: function () { return IdValidationService_1.IdValidationService; } });
|
|
17
|
+
const LoginService_1 = require("./login-service/LoginService");
|
|
18
|
+
Object.defineProperty(exports, "LoginService", { enumerable: true, get: function () { return LoginService_1.LoginService; } });
|
|
19
|
+
const LoginService_model_1 = require("./login-service/LoginService.model");
|
|
20
|
+
Object.defineProperty(exports, "UsernameType", { enumerable: true, get: function () { return LoginService_model_1.UsernameType; } });
|
|
21
|
+
const PublicService_1 = require("./public-service/PublicService");
|
|
22
|
+
Object.defineProperty(exports, "PublicService", { enumerable: true, get: function () { return PublicService_1.PublicService; } });
|
|
23
|
+
const TokenService_1 = require("./token-service/TokenService");
|
|
24
|
+
Object.defineProperty(exports, "TokenService", { enumerable: true, get: function () { return TokenService_1.TokenService; } });
|
|
25
|
+
const TokenService_model_1 = require("./token-service/TokenService.model");
|
|
26
|
+
Object.defineProperty(exports, "GrantType", { enumerable: true, get: function () { return TokenService_model_1.GrantType; } });
|
|
27
|
+
Object.defineProperty(exports, "TokenTypeHint", { enumerable: true, get: function () { return TokenService_model_1.TokenTypeHint; } });
|
|
28
|
+
Object.defineProperty(exports, "GroupAllowed", { enumerable: true, get: function () { return TokenService_model_1.GroupAllowed; } });
|
|
29
|
+
const UserService_1 = require("./user-service/UserService");
|
|
30
|
+
Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return UserService_1.UserService; } });
|
|
31
|
+
const UserService_model_1 = require("./user-service/UserService.model");
|
|
32
|
+
Object.defineProperty(exports, "ResetMedium", { enumerable: true, get: function () { return UserService_model_1.ResetMedium; } });
|
|
33
|
+
const VerificationService_1 = require("./verification-service/VerificationService");
|
|
34
|
+
Object.defineProperty(exports, "VerificationService", { enumerable: true, get: function () { return VerificationService_1.VerificationService; } });
|
|
35
|
+
const Common_model_1 = require("./common/Common.model");
|
|
36
|
+
Object.defineProperty(exports, "VerificationType", { enumerable: true, get: function () { return Common_model_1.VerificationType; } });
|
|
37
|
+
Object.defineProperty(exports, "ProcessingType", { enumerable: true, get: function () { return Common_model_1.ProcessingType; } });
|
|
@@ -1,143 +1,145 @@
|
|
|
1
1
|
import { LoginPrecheckRequest } from "../common/Common.model";
|
|
2
|
-
import { FirstTimeChangePasswordRequest, LoginAfterRegisterRequest, LoginWithCredentialsRequest,
|
|
2
|
+
import { FirstTimeChangePasswordRequest, LoginAfterRegisterRequest, LoginWithCredentialsRequest, PasswordlessLoginRequest, ProgressiveRegistrationHeader, SocialProviderPathParameter, SocialProviderQueryParameter } from "./LoginService.model";
|
|
3
3
|
import { CidaasUser } from "../common/User.model";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* ```
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
4
|
+
import ConfigUserProvider from "../common/ConfigUserProvider";
|
|
5
|
+
export declare class LoginService {
|
|
6
|
+
private config;
|
|
7
|
+
constructor(configUserProvider: ConfigUserProvider);
|
|
8
|
+
/**
|
|
9
|
+
* 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.
|
|
10
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/5gphdk6vapp56-classic-login#call-login-api for more details.
|
|
11
|
+
* @example
|
|
12
|
+
* ```js
|
|
13
|
+
* cidaasLoginService.loginWithCredentials({
|
|
14
|
+
* username: 'xxxx@gmail.com',
|
|
15
|
+
* username_type: 'email',
|
|
16
|
+
* password: '123456',
|
|
17
|
+
* requestId: 'your requestId',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
loginWithCredentials(options: LoginWithCredentialsRequest): void;
|
|
22
|
+
/**
|
|
23
|
+
* To login with social providers, call **loginWithSocial()**. This will redirect you to the facebook login page.
|
|
24
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9mi5uqxhqlsm5-social-login#call-social-login-api for more details
|
|
25
|
+
* @example
|
|
26
|
+
* ```js
|
|
27
|
+
* cidaasLoginService.loginWithSocial({
|
|
28
|
+
* provider: 'facebook',
|
|
29
|
+
* requestId: 'your requestId',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
loginWithSocial(options: SocialProviderPathParameter, queryParams?: SocialProviderQueryParameter): void;
|
|
34
|
+
/**
|
|
35
|
+
* To register with social providers, call **registerWithSocial()**. This will redirect you to the facebook login page.
|
|
36
|
+
* @example
|
|
37
|
+
* Note: giving the queryParams is not required.
|
|
38
|
+
* ```js
|
|
39
|
+
* queryParams = {
|
|
40
|
+
* dc: 'dc',
|
|
41
|
+
* device_fp: 'device_fp'
|
|
42
|
+
* }
|
|
43
|
+
* cidaasLoginService.registerWithSocial({
|
|
44
|
+
* provider: 'facebook',
|
|
45
|
+
* requestId: 'your requestId',
|
|
46
|
+
* }, queryParams);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
registerWithSocial(options: SocialProviderPathParameter, queryParams?: SocialProviderQueryParameter): void;
|
|
50
|
+
/**
|
|
51
|
+
* To authenticate without using password, call **passwordlessLogin()**.
|
|
52
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/k1lwsraxk0rjc-login-passwordless-request for more details.
|
|
53
|
+
* @example
|
|
54
|
+
* ```js
|
|
55
|
+
* cidaasLoginService.passwordlessLogin({
|
|
56
|
+
* requestId: 'your requestId',
|
|
57
|
+
* sub: 'your user sub',
|
|
58
|
+
* statusId: 'status id from authenticateMFA()'
|
|
59
|
+
* verificationType: 'your verificationType. e.g. VerificationType.Email'
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
passwordlessLogin(options: PasswordlessLoginRequest): void;
|
|
64
|
+
/**
|
|
65
|
+
* To continue after Consent acceptance, call **consentContinue()**.
|
|
66
|
+
* @example
|
|
67
|
+
* ```js
|
|
68
|
+
* cidaasLoginService.consentContinue({
|
|
69
|
+
* track_id: 'your track id'
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
consentContinue(options: LoginPrecheckRequest): void;
|
|
74
|
+
/**
|
|
75
|
+
* To continue after MFA completion, call **mfaContinue()**.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```js
|
|
79
|
+
* cidaasLoginService.mfaContinue({
|
|
80
|
+
* track_id: 'your track id'
|
|
81
|
+
* });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
mfaContinue(options: LoginPrecheckRequest): void;
|
|
85
|
+
/**
|
|
86
|
+
* to handle changing password by first login attempt after registration, call **firstTimeChangePassword()**.
|
|
87
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/fd8f478d96f58-continue-authentication-flow-after-prechecks for more details.
|
|
88
|
+
* @example
|
|
89
|
+
* ```js
|
|
90
|
+
* cidaasLoginService.firstTimeChangePassword({
|
|
91
|
+
* old_password: 'your old password',
|
|
92
|
+
* new_password: 'your new password',
|
|
93
|
+
* confirm_password: 'your new password'
|
|
94
|
+
* }, 'your track id');
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
firstTimeChangePassword(options: FirstTimeChangePasswordRequest, trackId: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* For progressive registration, call **progressiveRegistration()**. While logging in If the API returns 417 with the error message MissingRequiredFields, call the **getMissingFields** 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.
|
|
100
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/l7sknp2pytryr-progressive-registration for more details.
|
|
101
|
+
* @example
|
|
102
|
+
* ```js
|
|
103
|
+
* const options = {
|
|
104
|
+
* sub: 'your sub',
|
|
105
|
+
* }
|
|
106
|
+
* const headers = {
|
|
107
|
+
* trackId: 'the track id received while logging in',
|
|
108
|
+
* requestId: 'request id of the session',
|
|
109
|
+
* acceptlanguage: 'your locale/browser locale (OPTIONAL)',
|
|
110
|
+
* }
|
|
111
|
+
* cidaasLoginService.progressiveRegistration(options, headers)
|
|
112
|
+
* .then(function(response) {
|
|
113
|
+
* // type your code here
|
|
114
|
+
* })
|
|
115
|
+
* .catch(function (ex) {
|
|
116
|
+
* // your failure code here
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
progressiveRegistration(options: CidaasUser, headers: ProgressiveRegistrationHeader): Promise<any>;
|
|
121
|
+
/**
|
|
122
|
+
* To automatically do user login after successful registration, call **loginAfterRegister()**. Make sure to turn on "auto login after register" switch on the admin ui to activate loginAfterRegister flow.
|
|
123
|
+
* Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qwwamc2f378wi-auto-login-after-register for more details.
|
|
124
|
+
* @example
|
|
125
|
+
* ```js
|
|
126
|
+
* cidaasLoginService.loginAfterRegister({
|
|
127
|
+
* device_id: 'your device id',
|
|
128
|
+
* dc: 'device capacity'
|
|
129
|
+
* rememberMe: false,
|
|
130
|
+
* trackId: 'your track id',
|
|
131
|
+
* device_fp: 'device fingerprint'
|
|
132
|
+
* });
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
loginAfterRegister(options: LoginAfterRegisterRequest): void;
|
|
136
|
+
/**
|
|
137
|
+
* To do guest login after activating the feature from admin ui, call **actionGuestLogin()**
|
|
138
|
+
* Please refer to https://docs.cidaas.com/docs/cidaas-iam/95fd8492a64fe-guest-login for more details
|
|
139
|
+
* @example
|
|
140
|
+
* ```js
|
|
141
|
+
* cidaasLoginService.actionGuestLogin('your request id');
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
actionGuestLogin(requestId: string): void;
|
|
145
|
+
}
|