Authentication

The PlayFab Authentication plugin is the account security management for the PlayFab Master Collection.


The Authentication plugin supports various authentication methods, including company email address, username and password, Android login, iOS login, social connects including Facebook and Google Play, and custom identifications including custom cryptographic code.


Most plugins in the PlayFab Master Collection require the Authentication plugin to be able to run its account system features.

PlayFab API v2.png

Introduction

Step 1.png

The Construct Master Collection supports the full and easy integration of the PlayFab service for both Construct 3 and Construct 2.


Please click here to learn more about PlayFab.

Authentication Methods


The Authentication plugin manages the login/signup system for the account server system of your game. It utilizes the backend service of PlayFab to implement this. There are by default 6 methods of authentication, namely Company, Android, iOS, Facebook, Google Play and Cryptography.

  • Company - uses an email, username and password authentication. This is an authentication system where you can use the server allocation for your own company title.

  • Android - uses the Android device's UUID (Universally Unique Identifier) for authentication.

  • Mobile Info - this addon is required to obtain the mobile device's UUID.

  • iOS - uses the iOS device's UUID (Universally Unique Identifier) for authentication.

  • Mobile Info - this addon is required to obtain the mobile device's UUID.

  • Facebook - uses Facebook for authentication. This requires an access token to access the Facebook servers.

  • Mobile Facebook - this addon is required to use either the Android Facebook SDK or iOS Facebook SDK. This is where the authentication is implemented and then an Access Token is manually passed into the Authentication plugin.

  • Web Facebook - this addon is required to use the Web Facebook SDK. This is where the authentication is implemented and then an Access Token is manually passed into the Authentication plugin.

  • Google Play - uses Google Sign-In for authentication. This requires a ServerAuthCode​ to access the Google servers.

  • Google Sign-In - this addon is required to use the Android Google SDK or iOS Google SDK. This is where the authentication is implemented and then a "ServerAuthCode" is manually passed into the Authentication plugin.

  • Cryptography - also known as the Custom ID. This is a customized identification you can assign for each user as an authentication method. It's named cryptography due to its flexibility of being assigned with any string. This gives you freedom on how you want to implement authentication for your game.


The initial registration authentication method of players can be viewed in the players overview in the PlayFab console.


We are continuously working in adding more in the future. Please note that 3rd party porting services can easily and freely add more as well.


If you require an authentication method not available in the list, please contact support.



Editor Features


Here are some of the features in the Construct editor:

  • All platforms support, including web, mobile and desktop.

  • Construct 3

  • Construct 2

  • Native mobile integration

  • Construct 3 mobile build service

  • Construct 3 desktop build service

  • Android Studio

  • Xcode

  • Cordova CLI

 
 

How to use?

It is easy to use the Authentication plugin, you will only need to follow the steps below.

  1. Set up the PlayFab API plugin, please click to visit the documentation. This includes creating a PlayFab account, studio and title.

  2. Add the Authentication plugin into your project.


3. Finally, you can now use the Authentication object, and include more PlayFab addons for more features.


Introduction


The Authentication with PlayFab is easy while versatile, having covered most leading platforms, namely HTML5 Web, Android, iOS, Desktop, Steam, Facebook, Instant Games, Xbox, PlayStation, Nintendo and more. It brings enterprise scaled account system features for your online games, into your Construct 3 and Construct 2 projects. ​ It supports both web and native implementations, with other additional tools in the collection to support each platform, including mobile and desktop, and consoles through 3rd party porting services.



PlayFab has one of the most important features you'll need for an online game, cloud save. Cloud Save automatically stores and manages the data of users in dedicated servers hosted by Microsoft Azure through their PlayFab service, while being accessible by multiple devices through multiple authentication methods for each account.



The Authentication object with PlayFab has support for almost all platforms. But in this particular discussion, we will focus in mobile development, since it commonly utilizes this feature.



As you can observe from the images above, there are these concepts called Switch Account and Bind Account.

These are implemented in the PlayFab Master Collection as plugins, which in order are the Authentication and Sync Manager plugins.


But before that, an explanation on the process of authentication and sync is necessary to make this easier to understand.



Initially, when an application connects to PlayFab, a one-time process account registration is recommended.

There are many authentication methods to choose from, one of them are Company, Android, iOS, Facebook, Google Play and Cryptography.


You can choose any initial authentication method for the user, but a registration without a player input is ideal for games.

The player can just proceed to link and secure the account after making a better bond with the game. This ensures you attract more users by not hassling them from forced login.




Registering through generated ids are common with web applications using the Custom ID authentication method.


However, on mobile the common way of registration for authentication is through the device id, either the Android or iOS login.



You can still use social networks like Facebook and Google, or your own company's allocated server account system, using the Email, Username and Password registration.



Although, it is essential that the registration process is effortless for the players.



Once initially registered, the player's account will be created. Then the player can add more authentication methods through the Sync Manager.

This enables the same account to be accessed with different account methods, this is called account binding.


If the player wants to switch to a different account, the player can simply login to one of the authentication methods of that other account. This is called account switching.



PlayFab's online account system functionality covering all aspects of online game features is without of doubt important but easy to use. It is a useful skill to learn for game development and your technical career.

The PlayFab Master Collection is a set of online tools you can use for any online game application, and it only requires a bit of learning. And you may always contact support if ever you are in need of assistance.



Sync Manager


The Sync Manager plugin goes hand in hand with the Authentication plugin.



When a user logs in with new credentials using the Authentication plugin. The plugin, by default and if enabled in the action, automatically creates the user a game account.

Please note that for email, username and password authentication, company registration is a signup action. For login, please use the company login action. Once a user has already registered and logged into an account, the user account can add more authentication methods through linking other login or signup methods, with additional login credentials such as social network account login links.

Therefore, allowing the account to secure more authentication methods to login with the Authentication plugin, and access the user account in different devices. ​ Once a new authentication method is linked to an account, the user can then log in through that ​newly linked authentication method using the Authentication plugin, to access the same account.

 
 

Documentation

There is currently nothing to show, we will add more in the future.

 

Actions, Conditions & Expressions

Actions

Actions
Actions

The actions for the PlayFab API plugin.

press to zoom
Actions
Actions

The actions for the PlayFab API plugin.

press to zoom
1/1

The following actions groups:

  • Company Authentication

  • Platform Authentication

  • Quick Authentication

Company Authentication

  • Company Login - Login with Company Authentication Credentials.​​

  • Key - Depending on the method. The Key will either be the Email or Username.​

  • Password - The password for the company authentication.

  • Method - Choose the Key for the authentication. Either Email or Username.

  • When Email is chosen, one trigger condition response is fired at the condition group Company Email Login.​

  • When Username is chosen, one trigger condition response is fired at the condition group Company Username Login.

  • Company Register - Register with Company Authentication Credentials. One trigger condition response is fired at the condition group Company Register.​

  • Email - ​The Email Address for the new account.

  • Username - PlayFab username for the account. (3-20 characters)

  • Password - Password for the PlayFab account. (6-100 characters)

  • Display Name - An optional parameter for setting the display name for this title (game). (3-25 characters)


Quick Authentication

  • Android Device Login - Signs the user in using the Android device identifier. One trigger condition response is fired at the condition group Android Device Login.​

  • UUID - The Android Device's Unique Device ID. ​

  • Use the Mobile Info addon from the Mobile Master Collection to get the device's UUID.​

  • OS - ​The Android Device's Operating System.

  • Use the Mobile Info addon from the Mobile Master Collection to get the device's OSVersion.​​

  • Model - ​The Android Device's Model.

  • Use the Mobile Info addon from the Mobile Master Collection to get the device's Model.​​​

  • Create Account - Automatically create a PlayFab account if one is not currently linked to this ID.​ [Enabled or Disabled]


  • iOS Device Login - Signs the user in using the vendor-specific iOS device identifier. One trigger condition response is fired at the condition group iOS Device Login.​

  • UUID - Vendor-specific iOS identifier for the user's device. ​

  • Use the Mobile Info addon from the Mobile Master Collection to get the device's UUID.​

  • OS - ​Specific Operating System version for the user's device.

  • Use the Mobile Info addon from the Mobile Master Collection to get the device's OSVersion.​​

  • Model - ​Specific model of the user's device.

  • Use the Mobile Info addon from the Mobile Master Collection to get the device's Model.​​​

  • Create Account - Automatically create a PlayFab account if one is not currently linked to this ID.​ [Enabled or Disabled]


  • Custom ID Login - Signs the user in using a custom unique identifier generated by the title (game). One trigger condition response is fired at the condition group Custom ID Login.​

  • Custom ID - Custom unique identifier for the user, generated by the title. ​

  • Create Account - Automatically create a PlayFab account if one is not currently linked to this ID. [Enabled or Disabled]


Platform Authentication

  • Facebook Login - Signs the user in using a Facebook access token. One trigger condition response is fired at the condition group Facebook Login.​

  • Access Token - Unique identifier from Facebook to the user. ​

  • Use the Mobile Facebook addon from the Mobile Master Collection to access the Android Facebook SDK or iOS Facebook SDK. This is where the authentication is implemented and if successful, an Access Token can then be retrieved and then, manually input it into this parameter.

  • Use the Web Facebook addon from the Web Master Collection to access the Web Facebook SDK. This is where the authentication is implemented and if successful, an Access Token can then be retrieved and then, manually input it into this parameter.

  • Create Account - Automatically create a PlayFab account if one is not currently linked to this ID. [Enabled or Disabled]​


  • Google Login - Signs the user in using their Google account credentials. One trigger condition response is fired at the condition group Google Login.​

  • ServerAuthCode - OAuth 2.0 server authentication code obtained on the client by calling the getServerAuthCode().

  • Use the Google Sign-In addon from the Mobile Master Collection to access the Android Google SDK or iOS Google SDK. This is where the authentication is implemented and if successful, a ServerAuthCode can then be retrieved and then, manually input it into this parameter.​

  • Create Account - Automatically create a PlayFab account if one is not currently linked to this ID. [Enabled or Disabled]


Conditions

The following conditions groups:

  • Company Email Login

  • Company Username Login

  • Company Register

  • Android Device Login

  • Custom ID Login

  • Google Login

  • Tools

Conditions
Conditions

The conditions for the PlayFab API plugin.

press to zoom
Conditions
Conditions

The conditions for the PlayFab API plugin.

press to zoom
1/1

Company Email Login

  • On Company Email Login - Triggers when the Company Email Login Process succeeded.​

  • On Email Account not found - Triggers when the Company Email Account is not found.

  • On Invalid Email or Password - Triggers when the Company responded, Invalid Email or Password.

  • On Company Email Login Error - Triggers when the Company Email Login has failed with an error.



Company Username Login

  • On Company Username Login - Triggers when the Company Username Login Process succeeded.​

  • On Username not found - Triggers when the Company Username Account is not found.

  • On Invalid Username or Password - Triggers when the Company responded, Invalid Username or Password.

  • On Company Username Login Error - Triggers when the Company Username Login has failed with an error.



Company Register

  • On Company Register - Triggers when the Company Registration process succeeded.​

  • On Email Address Not Available - Triggers when the Company Register responded that the Email Address is not available.

  • On Invalid Email Address - Triggers when the Company Register responded that the Email Address is invalid.

  • On Invalid Password - Triggers when the Company Register responded that the Password is invalid.

  • On Invalid Username- Triggers when the Company Register responded that the Username is invalid.

  • On Name Not Available - Triggers when the Company Register responded that the Name is not available.

  • On Profane Display Name - Triggers when the Company Register responded that the Display Name is profane.

  • On Username Not Available - Triggers when the Company Register responded that the Username is not available.

  • On Company Register Error - Triggers when the Company Registration has failed with an error.



Android Device Login

  • On Android Device Login - Triggers when the Android Device Login Process succeeded.​

  • On Account not found - Triggers when the Account is not found.

  • On Android Login Error - Triggers when the Android Device ID login has failed with an error.



iOS Device Login

  • On iOS Device Login - Triggers when the iOS Device Login Process succeeded.​

  • On Account not found - Triggers when the Account is not found.

  • On Android Login Error - Triggers when the iOS Device ID login has failed with an error.



Custom ID Login

  • On Custom ID Login - Triggers when the Custom ID Login Process succeeded.​

  • On Account not found - Triggers when the Account is not found.

  • On Custom ID Login Error - Triggers when the Custom ID login has failed with an error.



Facebook Login

  • On Facebook Login - Triggers when the Facebook Process succeeded.​

  • On Facebook Account not found - Triggers when the Facebook Account is not found.

  • On Facebook Login Error - Triggers when the Facebook login has failed with an error.



Google Login

  • On Google Login - Triggers when the Google Login Process succeeded.​

  • On Google Account not found - Triggers when the Google Account is not found.

  • On Google Login Error - Triggers when the Google login has failed with an error.



Tools

  • Is Authenticating - Checks if a platform is authenticating.

  • Auth Method - The authentication method that is currently authenticating.

  • Company​

  • Facebook

  • Google Play

  • Android

  • iOS

  • Custom ID

  • Is Any Authenticating - Checks if any platform is authenticating.

Expressions

Expressions
Expressions

The expressions for the PlayFab API plugin.

press to zoom
Expressions
Expressions

The expressions for the PlayFab API plugin.

press to zoom
1/1

The following expressions groups:

  • Company Email Login

  • Company Username Login

  • Company Register

  • Android Device Login

  • iOS Device Login

  • Custom ID Login

  • Facebook Login

  • Google Login

  • Server Response

  • Global

Company Email Login

  • getEmailNewlyCreated - Return True if newly created or False if a simple login, from the Company Email Login.​

  • getEmailPlayFabID - Return the PlayFabID from the Company Email Login.

  • getEmailSessionTicket - Return the Session Ticket from the Company Email Login.



Company Username Login

  • getUsernameNewlyCreated - Return True if newly created or False if a simple login, from the Company Username Login.​

  • getUsernamePlayFabID - Return the PlayFabID from the Company Username Login.

  • getUsernameSessionTicket - Return the Session Ticket from the Company Username Login.



Company Register

  • getRegisterNewlyCreated - Return True if newly created or False if a simple login, from the Company Register.​

  • getRegisterPlayFabID - Return the PlayFabID from the Company Register.

  • getRegisterSessionTicket - Return the Session Ticket from the Company Register.



iOS Device Login

  • getIOSNewlyCreated - Return True if newly created or False if a simple login, from the iOS Device Login.​

  • getIOSPlayFabID - Return the PlayFabID from the iOS Device Login.

  • getIOSSessionTicket - Return the Session Ticket from the iOS Device Login.



Custom ID Login

  • getCustomIDNewlyCreated - Return True if newly created or False if a simple login, from the Custom ID Login.​

  • getCustomIDPlayFabID - Return the PlayFabID from the Custom ID Login.

  • getCustomIDSessionTicket - Return the Session Ticket from the Custom ID Login.


Facebook Login

  • getFacebookNewlyCreated - Return True if newly created or False if a simple login, from the Facebook Login.​

  • getFacebookPlayFabID - Return the PlayFabID from the Facebook Login.

  • getFacebookSessionTicket - Return the Session Ticket from the Facebook Login.



Google Login

  • getGoogleNewlyCreated - Return True if newly created or False if a simple login, from the Google Login.​

  • getGooglePlayFabID - Return the PlayFabID from the Google Login.

  • getGoogleSessionTicket - Return the Session Ticket from the Google Login.



Server Response

  • ServerResponse - Return the Server Response from every request from the PlayFab Server.​ The server response can also be shown in the Chrome Developer Tools : Console, if in debug mode.



Global

  • IsNewlyCreated - Return "True" if newly created or "False" if a regular login, from any recent login.

  • PlayFabID - Return the PlayFabID from any recent login.

  • SessionTicket - Return the Session Ticket from any recent login.

Object   Properties

Plugin Properties

1/0
 
 

Showcase

There is currently nothing to show, we will add more in the future.

 

Game Projects 

Instructions Kit

Construct 3 Project
Construct 3 Project

press to zoom
Construct 2 Project
Construct 2 Project

press to zoom
Construct 3 Project
Construct 3 Project

press to zoom
1/2

Specifications

  • Instructions - The game project contains instructions and steps on how to use the addon and its features.

  • Action, Conditions and Expressions - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks on the recommended ways of using the addon.

Supporters

Only