GoogleClientLogin Class
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
Parameters:
-
conf
ObjectAn object, with two properties: email and password
-
email
String -
password
String
-
Item Index
Methods
Events
Methods
_getAccountType
-
[params]
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:
_getRequestContent
-
params
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:
_parseData
()
Splits response data into key-value pairs, Only for internal usage
_parseLoginResponse
-
response
Parses the response of the login emits error and login event
Parameters:
-
response
http.ClientResponseThe response object
getAuthId
()
String | | undefined
Method to get the AuthId property
Returns:
getCaptchaToken
()
String | | undefined
Returns the value of the CaptchaToken property
Returns:
getCaptchaUrl
()
String | | undefined
Method to get the captcha url
Returns:
getError
()
Number | | undefined
Method to get the error code
Returns:
getLSID
()
String | | undefined
Method to get the LSID property
Returns:
getSID
()
String | | undefined
Method to ge the SID property
Returns:
isCaptchaRequired
()
Boolean
Method to know if captcha is required
Returns:
login
-
params
Logs in the user
Parameters:
-
params
Object(optional) You can pass the logincaptcha and logintoken and the accountType as properties
Events
login
Fires when login was success
loginFailed
Fires when login failed