LoginBuilder

LoginBuilder

(private) new LoginBuilder()

Login utilities
Source:

Methods

(static) setProductEmailParams(params) → {LoginBuilder}

Set Product Email template parameter
Source:
Parameters:
Name Type Description
params SimpleObject The parameters used to interpolare the template
Returns:
Type:
LoginBuilder
the same instance

(static) setSMSTemplate(smsTemplate) → {LoginBuilder}

Set the MSISDN pin forgot sms template
Source:
Parameters:
Name Type Description
smsTemplate string The SMS template
Returns:
Type:
LoginBuilder
the same instance

__setDomain(domain) → {LoginBuilder}

Set domain application. Used in MSISDN flow only. TEMPORARY AND ONLY FOR TEST!
Source:
Parameters:
Name Type Description
domain String the application domain
Returns:
Type:
LoginBuilder
the same instance

getCustomLoginFlow() → {CustomLoginFlow}

Create a custom login flow.
Source:
Returns:
Type:
CustomLoginFlow

getEmailConfirmFlow() → {EmailConfirmFlow}

Create an email login flow.
Source:
Returns:
Type:
EmailConfirmFlow

getEmailForgotFlow() → {EmailForgotFlow}

Create an email forgot flow.
Source:
Returns:
Type:
EmailForgotFlow

getEmailLoginFlow() → {EmailLoginFlow}

Create an email login flow.
Source:
Returns:
Type:
EmailLoginFlow

getEmailResendFlow() → {EmailResendFlow}

Create an email login flow.
Source:
Returns:
Type:
EmailResendFlow

getEmailSignupFlow() → {EmailSignupFlow}

Create an email signup flow.
Source:
Returns:
Type:
EmailSignupFlow

getExternalLoginFlow() → {ExternalLoginFlow}

Create an external login flow.
Source:
Returns:
Type:
ExternalLoginFlow

getGenericLoginFlow() → {GenericLoginFlow}

Create a generic login flow.
Source:
Returns:
Type:
GenericLoginFlow

getMSISDNPINForgotFlow() → {MSISDNPINForgotFlow}

Create a msisdn pin forgot flow.
Source:
Returns:
Type:
MSISDNPINForgotFlow

getMSISDNPINLoginFlow() → {MSISDNPINLoginFlow}

Create a msisdn pin login flow.
Source:
Returns:
Type:
MSISDNPINLoginFlow

getMSISDNURLoginFlow() → {MSISDNURLoginFlow}

Create a msisdn login flow.
Source:
Returns:
Type:
MSISDNURLoginFlow

getOAuthLoginFlow() → {OAuthLoginFlow}

Create a custom login flow.
Source:
Returns:
Type:
OAuthLoginFlow

getPaymentReceiptLoginFlow() → {PaymentReceiptLoginFlow}

Create a payment receipt login flow.
Source:
Returns:
Type:
PaymentReceiptLoginFlow

setAccessToken(access_token) → {LoginBuilder}

Set access token from oauth.
Source:
Parameters:
Name Type Description
access_token String The access token given
Returns:
Type:
LoginBuilder
the same instance

setAlias(alias) → {LoginBuilder}

Set Alias. Used in MSISDNPINLoginFlow
Source:
Parameters:
Name Type Description
alias String
Returns:
Type:
LoginBuilder
the same instance

setAllowCustomLogin() → {LoginBuilder}

Persist the custom login among the page refreshing. A session cookie is set.
Source:
Returns:
Type:
LoginBuilder
the same instance

setCustomData(loginData) → {LoginBuilder}

Set login data. Useful to track campaign parameters
Source:
Parameters:
Name Type Description
loginData Newton.SimpleObject the custom data for the login event
Returns:
Type:
LoginBuilder
the same instance

setCustomID(customID) → {LoginBuilder}

Set custom id. Used in custom flow only.
Source:
Parameters:
Name Type Description
customID String custom user id
Returns:
Type:
LoginBuilder
the same instance

setEmail(email) → {LoginBuilder}

Set email. Used in Email flows.
Source:
Parameters:
Name Type Description
email String the email
Returns:
Type:
LoginBuilder
the same instance

setEmailToken(email_token) → {LoginBuilder}

Set the email token. Used in EmailConfirmFlow
Source:
Parameters:
Name Type Description
email_token Object the email_token
Returns:
Type:
LoginBuilder
the same instance

setErrorUrl(errorUrl) → {LoginBuilder}

Set error url.
Source:
Parameters:
Name Type Description
errorUrl String
Returns:
Type:
LoginBuilder
the same instance

setExternalID(externalID) → {LoginBuilder}

Set external id. Used in external flow only.
Source:
Parameters:
Name Type Description
externalID String external user id
Returns:
Type:
LoginBuilder
the same instance

setForgot(forgot_token) → {LoginBuilder}

Set the email forgot token. Used in EmailConfirmForgotFlow
Source:
Parameters:
Name Type Description
forgot_token Object the forgot_token
Returns:
Type:
LoginBuilder
the same instance

setMSISDN(msisdn) → {LoginBuilder}

Set MSISDN. Used in MSISDNPINLoginFlow
Source:
Parameters:
Name Type Description
msisdn String
Returns:
Type:
LoginBuilder
the same instance

setNoPIN(pin) → {LoginBuilder}

Set a fake PIN in order to perform the login without PIN. Used in MSISDNPINLoginFlow. This method overwrite the previous "setPIN" setting
Source:
Parameters:
Name Type Description
pin String
Returns:
Type:
LoginBuilder
the same instance

setOAuthProvider(oauth) → {LoginBuilder}

Set oauth provider needed for OAuthLoginFlow
Source:
Parameters:
Name Type Description
oauth String provider
Returns:
Type:
LoginBuilder
the same instance

setOnFlowCompleteCallback(callback) → {LoginBuilder}

Set callback invoked when a login flow is ended
Source:
Parameters:
Name Type Description
callback FlowCompleteCallback Invoked at the end of the login flow
Returns:
Type:
LoginBuilder
the same instance

setOnForgotFlowCallback(callback) → {LoginBuilder}

Set callback invoked when a forgot flow is ended
Source:
Parameters:
Name Type Description
callback FlowCompleteCallback Invoked at the end of the login flow
Returns:
Type:
LoginBuilder
the same instance

setOperator(operator) → {LoginBuilder}

Set Operator. Used in MSISDNPINLoginFlow
Source:
Parameters:
Name Type Description
operator String
Returns:
Type:
LoginBuilder
the same instance

setPassword(password) → {LoginBuilder}

Set the password. Used in Email flows.
Source:
Parameters:
Name Type Description
password String the password
Returns:
Type:
LoginBuilder
the same instance

setPIN(pin) → {LoginBuilder}

Set PIN. Used in MSISDNPINLoginFlow
Source:
Parameters:
Name Type Description
pin String
Returns:
Type:
LoginBuilder
the same instance

setReturnUrl(returnUrl) → {LoginBuilder}

Set return url.
Source:
Parameters:
Name Type Description
returnUrl String
Returns:
Type:
LoginBuilder
the same instance

setSerializedPayment(blob) → {LoginBuilder}

Set serialized payment
Source:
Parameters:
Name Type Description
blob String the serialized payment
Returns:
Type:
LoginBuilder
the same instance

setSubscribeUrl(subscribeUrl) → {LoginBuilder}

Set subscribe url. Used in MSISDN flow only.
Source:
Parameters:
Name Type Description
subscribeUrl String the login url
Returns:
Type:
LoginBuilder
the same instance

setUsername(username) → {LoginBuilder}

Set username
Source:
Parameters:
Name Type Description
username String
Returns:
Type:
LoginBuilder
the same instance

setUserProperties(user_properties) → {LoginBuilder}

Set the user properties if the EmailSignupFlow succeeded
Source:
Parameters:
Name Type Description
user_properties Object the user_properties
Returns:
Type:
LoginBuilder
the same instance

setWaitingUrl(waitingUrl) → {LoginBuilder}

Set waiting url. Used in OAuthLoginFlow
Source:
Parameters:
Name Type Description
waitingUrl String
Returns:
Type:
LoginBuilder
the same instance