API Docs for:
Show:

GoogleClientLogin Class

Defined in: index.js:66

Helps to log in to any google service with the clientlogin method Google returns 3 values when login was success: Auth, SID, LSID

After the login you need to include the Auth value into the Authorization HTTP header on each request:

client.request('GET', '...', { ..., 'Authorization':'GoogleLogin auth=' + googleClientLoginInstance.getAuthId() })

Constructor

GoogleClientLogin

(
  • conf
)

Defined in index.js:66

Parameters:

  • conf Object

    An object, with two properties: email and password

    • email String
    • password String

Methods

_getAccountType

(
  • [params]
)
String

Defined in index.js:152

Method to find out which account type should we use, default is HOSTEDORGOOGLE Only for internal usage

Parameters:

  • [params] Object optional
    • [accountType] String optional

Returns:

String:

_getRequestContent

(
  • params
)

Defined in index.js:173

Method to create the content of the login request Only for internal usage

Parameters:

  • params Object

    (Optional) You can pass the logincaptcha and logintoken and the accountType as properties

Returns:

string

_parseData

()

Defined in index.js:98

Splits response data into key-value pairs, Only for internal usage

_parseLoginResponse

(
  • response
)

Defined in index.js:111

Parses the response of the login emits error and login event

Parameters:

  • response http.ClientResponse

    The response object

getAuthId

() String | | undefined

Defined in index.js:253

Method to get the AuthId property

Returns:

String | | undefined: the AuthId or undefined

getCaptchaToken

() String | | undefined

Defined in index.js:307

Returns the value of the CaptchaToken property

Returns:

String | | undefined: string or undefined

getCaptchaUrl

() String | | undefined

Defined in index.js:298

Method to get the captcha url

Returns:

String | | undefined: the value of the CaptchaUrl property or undefined

getError

() Number | | undefined

Defined in index.js:280

Method to get the error code

Returns:

Number | | undefined: the error code or undefined

getLSID

() String | | undefined

Defined in index.js:271

Method to get the LSID property

Returns:

String | | undefined: the value of the LSID property or undefined

getSID

() String | | undefined

Defined in index.js:262

Method to ge the SID property

Returns:

String | | undefined: the value of the SID property or undefined

isCaptchaRequired

() Boolean

Defined in index.js:289

Method to know if captcha is required

Returns:

Boolean:

login

(
  • params
)

Defined in index.js:218

Logs in the user

Parameters:

  • params Object

    (optional) You can pass the logincaptcha and logintoken and the accountType as properties

Events

login

Defined in index.js:134

Fires when login was success

loginFailed

Defined in index.js:140

Fires when login failed