Constructors

Methods

  • To change the password, call changePassword(). This will allow you to change your password. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/8221883241464-change-password for more details.

    Parameters

    Returns Promise<any>

    cidaasUserService.changePassword({
    old_password: 'your old password',
    new_password: 'your new password',
    confirm_password: 'your new password',
    sub: 'your sub',
    })
    .then(function () {
    // your success code
    }).catch(function (ex) {
    // your failure code
    });
  • To complete account linking, call completeLinkAccount().

    Parameters

    Returns Promise<any>

    const options = {
    code: 'code which is sent to account to be linked',
    link_request_id: 'comes from initiateLinkAccount'
    }
    cidaasUserService.completeLinkAccount(options).then((response) => {
    // your success code
    }).catch((err) => {
    // your failure code here
    });
  • To use the existing users in deduplication, you need to call deduplicationLogin().

    Parameters

    Returns void

    cidaasUserService.deduplicationLogin({
    sub: 'your sub',
    requestId: 'request id from deduplication initialisation after register',
    trackId: 'track id from deduplication initialisation after register'
    })
  • Once registration successful, verify the account based on the flow. To get the details, call getCommunicationStatus().

    Parameters

    Returns Promise<any>

    cidaasUserService.getCommunicationStatus({
    sub: 'your sub', // which you will get on the registration response
    }).then(function (response) {
    // the response will give you account details once its verified.
    }).catch(function(ex) {
    // your failure code here
    });
  • To get the list of existing users in deduplication, call getDeduplicationDetails().

    Parameters

    Returns Promise<any>

    cidaasUserService.getDeduplicationDetails({
    track_id: 'your track id'
    }).then((response) => {
    // the response will give you deduplication details of users.
    }).catch((err) => {
    // your failure code here
    });
  • to get information about invitation details, call getInviteUserDetails(). This API allows to retrieve invitation details and prefill the registration form. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details. Minimum cidaas version to use latest api is v3.100

    Parameters

    Returns Promise<any>

    const options = {
    invite_id: 'id of user invitation'
    callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called
    }
    cidaasUserService.getInviteUserDetails(options)
    .then(function () {
    // the response will give you information about the invitation.
    }).catch(function (ex) {
    // your failure code here
    });
  • To get all the linked accounts, call getLinkedUsers().

    Parameters

    • sub: string
    • Optionalaccess_token: string

    Returns Promise<any>

    const sub = 'your sub';

    cidaasUserService.getLinkedUsers(sub)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To handle registration, first you need the registration fields. To get the registration fields, call getRegistrationSetup(). This will return the fields that has to be needed while registration. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4eae72956f65a-registration-field-setup for more details.

    Parameters

    Returns Promise<any>

    cidaasUserService.getRegistrationSetup({
    requestId: 'your requestId',
    acceptlanguage: 'your locale' // optional example: de-de, en-US
    }).then(function (resp) {
    // the response will give you fields that are required.
    }).catch(function(ex) {
    // your failure code here
    });
  • To get user activities, call getUserActivities(). Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/346141453781e-get-user-activities for more details.

    Parameters

    Returns Promise<any>

    const options = {
    sub: 'your sub',
    dateFilter: {
    from_date: 'date in UTC format',
    to:date: 'date in UTC format'
    }
    };
    cidaasUserService.getUserActivities(options).then(function (resp) {
    // your success code
    }).catch(function(ex) {
    // your failure code
    });
  • To get the user profile information by using cidaas internal api, call getUserProfile(). Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2zfvjx3vtq6g6-get-user-info for more details.

    Parameters

    Returns Promise<any>

    cidaasUserService.getUserProfile()
    .then(function () {
    // the response will give you user profile information.
    }).catch(function (ex) {
    // your failure code here
    });
  • To handle the reset password by entering the verification code you received, call handleResetPassword(). This will check if your verification code was valid or not, and allows you to proceed to the next step. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3t8ztokeb7cfz-handle-reset-password for more details.

    Parameters

    Returns Promise<any>

    const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, the response information will be given as query parameter in redirect url.';
    cidaasUserService.handleResetPassword({
    code: 'your code in email or sms or ivr',
    resetRequestId: 'your resetRequestId' // which you will get on initiate reset password response
    }, handleResponseAsJson).then(function (response) {
    // the response will give you valid verification code.
    }).catch(function(ex) {
    // your failure code here
    });
  • To initiate account linking, call initiateLinkAccount().

    Parameters

    Returns Promise<any>

    const options = {
    master_sub: 'sub of the user who initiates the user link',
    user_name_to_link: 'username of the user which should get linked',
    user_name_type: 'type of user name to link. E.g. email'
    }
    cidaasUserService.initiateLinkAccount(options).then((response) => {
    // your success code
    }).catch((err) => {
    // your failure code here
    });
  • 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.

    Parameters

    Returns Promise<any>

    cidaasUserService.initiateResetPassword({
    email: 'xxxxxx@xxx.com',
    processingType: ProcessingType.Code,
    requestId: 'your requestId',
    resetMedium: ResetMedium.Email
    }).then(function (response) {
    // the response will give you password reset details.
    }).catch(function(ex) {
    // your failure code here
    });
  • To register user, call register(). This method will create a new user. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/427632e587203-register-a-new-user for more details. Note: Only requestId in the headers is required.

    Parameters

    Returns Promise<any>

    const headers = {
    requestId: 'your_received_requestId',
    captcha: 'captcha',
    acceptlanguage: 'acceptlanguage',
    bot_captcha_response: 'bot_captcha_response'
    };

    cidaasUserService.register({
    email: 'xxx123@xxx.com',
    given_name: 'xxxxx',
    family_name: 'yyyyy',
    password: '123456',
    password_echo: '123456',
    provider: 'your provider', // FACEBOOK, GOOGLE, SELF
    acceptlanguage: 'your locale' // optional example: de-de, en-US
    }, headers).then(function (response) {
    // the response will give you client registration details.
    }).catch(function(ex) {
    // your failure code here
    });
  • To register new user in deduplication, call registerDeduplication().

    Parameters

    Returns Promise<any>

    cidaasUserService.registerDeduplication({
    track_id: 'track id from deduplication initialisation after register',
    }).then((response) => {
    // the response will give you new registered deduplication user.
    }).catch((err) => {
    // your failure code here
    });
  • To finish reseting the password, call resetPassword(). This will allow you to change your password. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qa9ny0gkzlf6y-accept-reset-password for more details.

    Parameters

    Returns Promise<any>

    const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, user will be redirected to success page after successful reset password.';
    cidaasUserService.resetPassword({
    password: '123456',
    confirmPassword: '123456',
    exchangeId: 'your exchangeId', // which you will get on handle reset password response
    resetRequestId: 'your resetRequestId' // which you will get on handle reset password response
    }).then(function (response) {
    // the response will give you reset password details.
    }).catch(function(ex) {
    // your failure code here
    });
  • To unlink an account for a user, call unlinkAccount().

    Parameters

    • access_token: string
    • identityId: string

    Returns Promise<any>

    const identityId = "comes from getLinkedUsers";

    cidaasUserService.unlinkAccount(undefined, identityId)
    .then(function (response) {
    // type your code here
    })
    .catch(function (ex) {
    // your failure code here
    });
  • To update the user profile information, call updateProfile(). After updating the user profile, the information in user storage won't be automatically updated. To get the latest user profile information, you will need to call getUserProfile(). To update the user storage, you will need to call renewToken() to generate latest tokens (access token, id token, refresh token) & user informations. Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/i3uqnxcpxr19r-update-user-profile for more details.

    Parameters

    • options: CidaasUser
    • sub: string
    • Optionalaccess_token: string

    Returns Promise<any>

    cidaasUserService.updateProfile({
    family_name: 'Doe',
    given_name: 'John',
    provider: 'self',
    acceptlanguage: 'your locale' // optional example: de-de, en-US
    }, 'your sub' ).then(function () {
    // the response will give you updated user profile info.
    }).catch(function (ex) {
    // your failure code here
    });
  • To change profile image, call updateProfileImage().

    Parameters

    Returns Promise<any>

    const options = {
    image_key: 'id for your image e.g. user sub',
    photo: yourImageFile,
    filename: 'name of your image file'
    };
    cidaasUserService.updateProfileImage(options).then(function (resp) {
    // your success code
    }).catch(function(ex) {
    // your failure code
    });
  • To run predefined action after enrollment, call userActionOnEnrollment()

    Parameters

    Returns Promise<any>

    const options = {
    action: 'predefined action'
    };
    cidaasUserService.userActionOnEnrollment(options, 'trackId'
MMNEPVFCICPMFPCPTTAAATR