rex_parse_tokenAuth
Introduction
Authentication by tokens in cloud code.
Authentication by tokens in cloud code.
Usage
Sample capx
Sample capx
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
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.
Random token value could be read by "Expression:LastToken".
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.
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.
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".
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.
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.
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,
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,