LoginChallenger

LoginChallenger

This module will be makes challenge to login to DiMORA.
このモジュールは、 DiMORA へログインするためのチャレンジを行います。

Constructor

new LoginChallenger(callback)

A method to initialize an instance and start challenging the login.
This method will be return a CAPTCHA image via the callback.
Then, you need to provide the login ID, password, and the answer of CAPTCHA to LoginChallenger#finish method.

インスタンスを初期化し、ログインのためのチャレンジを開始するメソッド。
本メソッドを呼び出すと、コールバックにより、CAPTCHA画像が得られますので、
続けて、ログインID、パスワード、CAPTCHAの回答を揃えて、LoginChallenger#finish メソッドを呼び出してください。

Source:
Parameters:
Name Type Description
callback LoginChallenger~startCallback An callback function

Methods

finish(login_id, login_pw, captcha_answer, callback)

A method to finish the login challenge.
This method returns the session data that after logged-in, via the callback.
You can use this session data on DimoraClient.

ログインのチャレンジを完了するためのメソッド。
このメソッドは、コールバックを介し、ログイン後のセッションデータを返します。
このセッションデータは DimoraClient で使用することができます。

Source:
Parameters:
Name Type Description
login_id String An login ID of DiMORA
login_pw String An login password
captcha_answer String An answer of CAPTCHA image
callback LoginChallenger~finishCallback An callback function

Type Definitions

finishCallback(error, session_json)

An callback of LoginChallenger.finish(...) method. It has the result of login challenge.
Source:
Parameters:
Name Type Description
error Error An error object (If something happened)
session_json String A session json
You can skip challenge from next time by use this session json.

startCallback(error, captcha_img_buffer)

An callback of LoginChallenger.start(...) method. It has the captcha image.
Source:
Parameters:
Name Type Description
error Error An error object (If something happened)
captcha_img_buffer Buffer An buffer of the CAPTCHA image