cidaas-javascript-sdk 4.3.2 → 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.
Files changed (51) hide show
  1. package/CHANGELOG.md +57 -5
  2. package/README.md +109 -94
  3. package/dist/authentication-service/AuthenticationService.d.ts +140 -0
  4. package/dist/authentication-service/AuthenticationService.js +210 -0
  5. package/dist/{authentication/Authentication.model.d.ts → authentication-service/AuthenticationService.model.d.ts} +18 -12
  6. package/dist/{authentication/Authentication.model.js → authentication-service/AuthenticationService.model.js} +2 -2
  7. package/dist/common/Common.model.d.ts +15 -19
  8. package/dist/common/Common.model.js +17 -17
  9. package/dist/common/ConfigUserProvider.d.ts +10 -0
  10. package/dist/common/ConfigUserProvider.js +28 -0
  11. package/dist/common/Helper.d.ts +7 -0
  12. package/dist/common/Helper.js +19 -0
  13. package/dist/common/User.model.d.ts +0 -4
  14. package/dist/consent-service/ConsentService.d.ts +99 -95
  15. package/dist/consent-service/ConsentService.js +125 -122
  16. package/dist/consent-service/ConsentService.model.d.ts +14 -16
  17. package/dist/device-service/DeviceService.d.ts +49 -0
  18. package/dist/device-service/DeviceService.js +79 -0
  19. package/dist/device-service/DeviceService.model.d.ts +6 -0
  20. package/dist/id-validation-service/IdValidationService.d.ts +28 -0
  21. package/dist/id-validation-service/IdValidationService.js +59 -0
  22. package/dist/id-validation-service/IdValidationService.model.d.ts +8 -0
  23. package/dist/id-validation-service/IdValidationService.model.js +2 -0
  24. package/dist/index.d.ts +22 -3
  25. package/dist/index.js +35 -18
  26. package/dist/login-service/LoginService.d.ts +143 -141
  27. package/dist/login-service/LoginService.js +225 -234
  28. package/dist/login-service/LoginService.model.d.ts +9 -53
  29. package/dist/login-service/LoginService.model.js +1 -1
  30. package/dist/public-service/PublicService.d.ts +57 -0
  31. package/dist/public-service/PublicService.js +73 -0
  32. package/dist/public-service/PublicService.model.d.ts +20 -0
  33. package/dist/public-service/PublicService.model.js +2 -0
  34. package/dist/token-service/TokenService.d.ts +104 -138
  35. package/dist/token-service/TokenService.js +164 -219
  36. package/dist/token-service/TokenService.model.d.ts +3 -44
  37. package/dist/token-service/TokenService.model.js +3 -16
  38. package/dist/user-service/UserService.d.ts +381 -315
  39. package/dist/user-service/UserService.js +552 -426
  40. package/dist/user-service/UserService.model.d.ts +48 -14
  41. package/dist/user-service/UserService.model.js +4 -4
  42. package/dist/verification-service/VerificationService.d.ts +281 -217
  43. package/dist/verification-service/VerificationService.js +343 -281
  44. package/dist/verification-service/VerificationService.model.d.ts +18 -5
  45. package/package.json +6 -4
  46. package/dist/authentication/Authentication.d.ts +0 -139
  47. package/dist/authentication/Authentication.js +0 -186
  48. package/dist/web-auth/WebAuth.d.ts +0 -665
  49. package/dist/web-auth/WebAuth.js +0 -955
  50. package/dist/web-auth/webauth.model.d.ts +0 -66
  51. /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,6 @@
1
+ export interface DeleteDeviceRequest {
2
+ /** id of device associated to the client */
3
+ device_id: string;
4
+ /** user-agent information from the browser */
5
+ userAgent?: string;
6
+ }
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,22 @@
1
- import { WebAuth } from "./web-auth/WebAuth";
2
- export * from './authentication/Authentication';
3
- export { WebAuth };
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.WebAuth = void 0;
18
- const WebAuth_1 = require("./web-auth/WebAuth");
19
- Object.defineProperty(exports, "WebAuth", { enumerable: true, get: function () { return WebAuth_1.WebAuth; } });
20
- __exportStar(require("./authentication/Authentication"), exports);
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, MfaContinueRequest, PasswordlessLoginRequest, ProgressiveRegistrationHeader, SocialProviderPathParameter, SocialProviderQueryParameter } from "./LoginService.model";
2
+ import { FirstTimeChangePasswordRequest, LoginAfterRegisterRequest, LoginWithCredentialsRequest, PasswordlessLoginRequest, ProgressiveRegistrationHeader, SocialProviderPathParameter, SocialProviderQueryParameter } from "./LoginService.model";
3
3
  import { CidaasUser } from "../common/User.model";
4
- /**
5
- * 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.
6
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/5gphdk6vapp56-classic-login#call-login-api for more details.
7
- * @example
8
- * ```js
9
- * cidaas.loginWithCredentials({
10
- * username: 'xxxx@gmail.com',
11
- * username_type: 'email',
12
- * password: '123456',
13
- * requestId: 'your requestId',
14
- * });
15
- * ```
16
- */
17
- export declare function loginWithCredentials(options: LoginWithCredentialsRequest): void;
18
- /**
19
- * To login with social providers, call **loginWithSocial()**. This will redirect you to the facebook login page.
20
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9mi5uqxhqlsm5-social-login#call-social-login-api for more details
21
- * @example
22
- * ```js
23
- * cidaas.loginWithSocial({
24
- * provider: 'facebook',
25
- * requestId: 'your requestId',
26
- * });
27
- * ```
28
- */
29
- export declare function loginWithSocial(options: SocialProviderPathParameter, queryParams?: SocialProviderQueryParameter): void;
30
- /**
31
- * To register with social providers, call **registerWithSocial()**. This will redirect you to the facebook login page.
32
- * @example
33
- * Note: giving the queryParams is not required.
34
- * ```js
35
- * queryParams = {
36
- * dc: 'dc',
37
- * device_fp: 'device_fp'
38
- * }
39
- * cidaas.registerWithSocial({
40
- * provider: 'facebook',
41
- * requestId: 'your requestId',
42
- * }, queryParams);
43
- * ```
44
- */
45
- export declare function registerWithSocial(options: SocialProviderPathParameter, queryParams?: SocialProviderQueryParameter): void;
46
- /**
47
- * To authenticate without using password, call **passwordlessLogin()**.
48
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/k1lwsraxk0rjc-login-passwordless-request for more details.
49
- * @example
50
- * ```js
51
- * cidaas.passwordlessLogin({
52
- * requestId: 'your requestId',
53
- * sub: 'your user sub',
54
- * statusId: 'status id from authenticateMFA()'
55
- * verificationType: 'your verificationType. e.g. VerificationType.EMAIL'
56
- * });
57
- * ```
58
- */
59
- export declare function passwordlessLogin(options: PasswordlessLoginRequest): void;
60
- /**
61
- * To continue after Consent acceptance, call **consentContinue()**.
62
- * @example
63
- * ```js
64
- * cidaas.consentContinue({
65
- * track_id: 'your track id'
66
- * });
67
- * ```
68
- */
69
- export declare function consentContinue(options: LoginPrecheckRequest): void;
70
- /**
71
- * To continue after MFA completion, call **mfaContinue()**.
72
- * options: PhysicalVerificationLoginRequest is not needed anymore. It is now DEPRECATED and will be removed in the next major release
73
- *
74
- * @example
75
- * ```js
76
- * cidaas.mfaContinue({
77
- * track_id: 'your track id'
78
- * });
79
- * ```
80
- */
81
- export declare function mfaContinue(options: MfaContinueRequest): void;
82
- /**
83
- * to handle changing password by first login attempt after registration, call **firstTimeChangePassword()**.
84
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/fd8f478d96f58-continue-authentication-flow-after-prechecks for more details.
85
- * @example
86
- * ```js
87
- * cidaas.firstTimeChangePassword({
88
- * sub: 'your sub',
89
- * old_password: 'your old password',
90
- * new_password: 'your new password',
91
- * confirm_password: 'your new password',
92
- * loginSettingsId: 'loginSettingsId'
93
- * });
94
- * ```
95
- */
96
- export declare function firstTimeChangePassword(options: FirstTimeChangePasswordRequest): void;
97
- /**
98
- * 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.
99
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/l7sknp2pytryr-progressive-registration for more details.
100
- * @example
101
- * ```js
102
- * const options = {
103
- * sub: 'your sub',
104
- * }
105
- * const headers = {
106
- * trackId: 'the track id received while logging in',
107
- * requestId: 'request id of the session',
108
- * acceptlanguage: 'your locale/browser locale (OPTIONAL)',
109
- * }
110
- * cidaas.progressiveRegistration(options, headers)
111
- * .then(function(response) {
112
- * // type your code here
113
- * })
114
- * .catch(function (ex) {
115
- * // your failure code here
116
- * });
117
- * ```
118
- */
119
- export declare function progressiveRegistration(options: CidaasUser, headers: ProgressiveRegistrationHeader): Promise<any>;
120
- /**
121
- * 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.
122
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qwwamc2f378wi-auto-login-after-register for more details.
123
- * @example
124
- * ```js
125
- * cidaas.loginAfterRegister({
126
- * device_id: 'your device id',
127
- * dc: 'device capacity'
128
- * rememberMe: false,
129
- * trackId: 'your track id',
130
- * device_fp: 'device fingerprint'
131
- * });
132
- * ```
133
- */
134
- export declare function loginAfterRegister(options: LoginAfterRegisterRequest): void;
135
- /**
136
- * To do guest login after activating the feature from admin ui, call **actionGuestLogin()**
137
- * Please refer to https://docs.cidaas.com/docs/cidaas-iam/95fd8492a64fe-guest-login for more details
138
- * @example
139
- * ```js
140
- * cidaas.actionGuestLogin('your request id');
141
- * ```
142
- */
143
- export declare function actionGuestLogin(requestId: string): void;
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
+ }