1.3.0 • Published 6 months ago

bugyo-cloud-client v1.3.0

Weekly downloads
6
License
MIT
Repository
github
Last release
6 months ago

TypeScript BUGYO Cloud Client

Usage

const bcc = require('bugyo-cloud-client');

// Implement LoggerFactory
const loggerFactory = {
  getLogger(name) {
    // (snip)
  }
};
// Settings
const tenantCode = "Bugyo cloud tenant code";
const loginId = "Your login id";
const password = "Your password";

// Create tasks
const loginTask = new bcc.LoginTask({ loginId, password }, loggerFactory);
const punchTask = new bcc.PunchTask({ clockType: "ClockIn" }, loggerFactory);
const logoutTask = new bcc.LogoutTask(loggerFactory);

// Create a client
const client = new bcc.BugyoCloudClient(tenantCode);

// Do tasks
await client.doA(loginTask); // At first, must do login
await client.doA(punchTask);
await client.doA(logoutTask);

See a sample.

Testing

npm test

Running a sample

npm run sample TenantCode LoginId Password

画面あるいは API

認証画面

認証方法チェック

  • URL: https://id.obc.jp/{{テナント?}}/login/CheckAuthenticationMethod
  • METHOD: POST
  • Headers:
    • __RequestVerificationToken: 認証画面のフォームにある hidden value
    • Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    • X-Requested-With: XMLHttpRequest
  • Content:
    • "OBCiD" : ログイン ID
    • "isBugyoCloud" : "false"
  • Response:
    • Headers:
      • Content-Type: application/json; charset=utf-8
    • Content:
      • AuthenticationMethod
      • SAMLButtonText
      • PasswordButtonText

認証

  • URL: https://id.obc.jp/{{テナント?}}/login/login/?Length=5
  • METHOD: POST
  • Headers:
    • Content-Type: application/x-www-form-urlencoded; charset=UTF-8
  • Content:
    • "btnLogin" : ""
    • "OBCID" : ログイン ID
    • "Password_d1" : ""
    • "Password_d2" : ""
    • "Password_d3" : ""
    • "Password" : パスワード
    • "__RequestVerificationToken" : 認証画面のフォームにある input hidden value
    • "X-Requested-With" : "XMLHttpRequest"
  • Response:
    • Headers:
      • Content-Type: application/json; charset=utf-8
    • Content:
      • RedirectURL
      • LoginOBCiD

レスポンスにある RedirectURL を GET すると 302 が返ります。 302 に従うと、ユーザ初期画面へ遷移します。URL は、https://hromssp.obc.jp/{{テナント?}}/{{ユニーク文字列?}}/ のようになります。

ユーザ初期画面

認証後の 302 応答に従うとたどり着きます。

ユニーク文字列の部分を、このあとの処理で使います。

打刻画面

打刻

打刻種類

  • 出勤 = "ClockIn"
  • 退出 = "ClockOut"

ログアウト

1.2.2

6 months ago

1.3.0

6 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.1.2

11 months ago

1.1.0-0

11 months ago

1.0.0

2 years ago

0.3.0

2 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago