Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_parse_tokenAuth

Plugin, ACE table, Discussion thread
Dependence:
rex_parse_initialize

Introduction
Authentication by tokens in cloud code.

Usage
Sample capx

Prepare
Add 
rex_parse_initialize to set api id and javascript key.
Cloud code
Append and update these code on parse cloud.

This cloud code will access a parse table named
"MasterTokenStorage", this table is restricted access control only by cloud code.
Reference: cloud code

Create account
Call one of these action to create an account.
  • "Action:Create account" to sign-up with a specific token
  • "Action:Create by random string" to sign-up with a random string token generated by cloud code.
"Condition:On creating account successfully" will be triggered if creating successful, otherwise "Condition:On creating account error" for creating error. Get error message by "Expression:ErrorMessage" or error code by "Expression:ErrorCode".
Random token value could be read by "
Expression:LastToken".
Add initial user data
Call "
Action:Set value" or "Action:Set boolean value" before "
Action:Create account", or 
"Action:Create by random string", to add extra initial user data.
Login
Call "Action:Login"
to login by token.
"Condition:On login successfully" will be triggered if login successful; otherwise "Condition:On login error" will be triggered.
Get user name and user ID by "
Expression:UserName" and "Expression:UserID".

Bind
Call "Action:Bind" to bind another token with current login account. "Condition:On bind successfully" will be triggered if login successful; otherwise "Condition:On bind error" will be triggered.
User could use this new bind token to login after binding successfully.
Logging out
Call "
Action:Logging out" to log out.

Login counter
Set "
Login counter" to "Yes" to enable counting login times.
Get login counter by "
Expression:LoginCount", return 1 while 1st login, return 2 is 2nd login, and so on,
_

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About