Authentication
Authentication module will be used by Connection. This module allows authenticating with the Kintone app by password authenticator or API token authenticator. This module is also supported the basic authenticator.
Warning
- If both the Token and Password Authentication are specified, the Token Authentication will be ignored and the Password authentication will be used.
Constructor
Parameter
(none)
Sample code
Init authentication module
Javascript
var kintoneAuth = new kintoneJSSDK.Auth();
Nodejs
const kintone = require('@kintone/kintone-js-sdk'); let kintoneAuth = new kintone.Auth();
Methods
setPasswordAuth(username, password)
Set password authentication for Authentication module.
Parameter
Name | Type | Required | Description |
---|---|---|---|
username | String | yes | The username that is able to authenticate on kintone app |
password | String | yes | The password that is able to authenticate on kintone app |
Return
Sample code
Set password authentication
Javascript
var username = '{your_user_name}'; var password = '{your_password}'; kintoneAuth.setPasswordAuth(username, password);
Nodejs
let username = '{your_user_name}'; let password = '{your_password}'; kintoneAuth.setPasswordAuth(username, password);
setApiToken(apiToken)
Set Api Token for Authentication module.
Parameter
Name | Type | Required | Description |
---|---|---|---|
apiToken | String | yes | The apiToken that is able to authenticate on kintone app |
Return
Set APIToken authentication
Javascript
var apiToken = '{your_token}'; kintoneAuth.setApiToken(apiToken);
Nodejs
let apiTokenString = '{your_token}'; kintoneAuth.setApiToken(apiTokenString);
setBasicAuth(username, password)
Set Basic authentication for Authentication module.
Parameter
Name | Type | Required | Description |
---|---|---|---|
username | String | yes | The username that is able to authenticate on kintone app |
password | String | yes | The password that is able to authenticate on kintone app |
Return
Sample code
Set basic authentication
Javascript
var username = '{your_user_name}'; var password = '{your_password}'; kintoneAuth.setBasicAuth(username, password);
Nodejs
let username = '{your_user_name}'; let password = '{your_password}'; kintoneAuth.setBasicAuth(username, password);