Authentication

The PlayFab Authentication is the security requirement for the PlayFab Master Collection for most features.

The Authentication addon supports company based authentication through email and password, mobile device UDID for both Android and iOS, social authentications like Facebook and Google Plus and custom ids which can be used for custom cryptographic authentications.

Most addons in the PlayFab Master Collection require the PlayFab Authentication Module to be able to do its functions since those features are user-based.

 

Intstructions

1. The first step is to add the PlayFab API addon into the project.

2. Next is to add the Authentication addon into the project.

Authentication Methods

Company

Android

iOS

Facebook

Google Plus

Cryptography

The Authentication addon manages the login/signup system for the account server system of your game. It utilizes the back-end service of PlayFab to implement this. There are 6 methods of registration, namely the Company, Android, iOS, FacebookGoogle Plus and Cryptography.

  • Company - uses an email, username, password authentication. This is a registration 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 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 Plus - uses Google Plus for authentication. This requires a ServerAuthCode​ to access the Google servers.

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

  • Cryptography - also knows as a Custom ID. This is a customized identification you can assign for each user as an authentication method. It is named cryptography because it goes without saying that if you want each account to be secure and unique, there should be a mathematical algorithm in this process, although it is optional, you can still just assign each user a number from 0, 1, 2, etc.. This gives you freedom on how you want to implement your authentication for your game.

Sync Manager

The Sync Manager goes well hand in hand with the Authentication addon. Once a user is registered through the Authentication addon, It can add more authentication methods through syncing or binding. Hence, enabling the account to sync its data to more authentication methods available with the Authentication addon.

The available sync methods are the same with the available authentication methods. Once synced, the user can then login with that ​sync method through the Authentication addon.

For more information, read the tutorial.

That is the Introduction to Authentication & Sync.

 
 

Introduction

The Authentication with PlayFab is very convenient while versatile, having covered most leading platforms, namely Web,  Android, iOS, Desktop, Facebook, Instant Games, XBOX, PlayStation, Nintendo, etc. It brings enterprise-level features for your online games, specifically an account system authentication where the Authentication plugin delivers to both Construct 3 and Construct 2 professionally.

It supports both web and native implementation, with other additional tools in the collection for each platform. Hence, providing a suitable tool and ensuring the best performance.

The Authentication with PlayFab has one of the most important features you'll need in your games, especially online ones.

The Cloud Save stores the data of users in the cloud while syncing it through different authentication methods.

The Authentication with PlayFab has native support for almost all platforms. But in this particular discussion, I'll be discussing the implementation in mobile development.
But as previously mentioned, this is still applicable in almost all popular platforms as well.

As you can see at the images, there are these concepts called Switch Account and Bind Account
These can be translated to the plugins in the PlayFab Master Collection, 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 the PlayFab Module, an one-process account registration is necessary. There are many ways of doing this, and it is through the authentication methods, which previously mentioned are Company, Android, iOS, FacebookGoogle Plus and Cryptography.

You can choose any registration method for the users, but ideally, a non-user defined registration is better for games or any application in fact, where they are registered through a generated unique id or through the device id, and the users can just add more authentication methods in the future as they proceed, this is called account binding (refer to the image beside), which is implemented by the Sync Manager plugin.

Registering through generated ids are common with web applications using the custom id authentication or sync method. On mobile, the common way of registration for authentication is through the device id, which is the Android ID or iOS ID authentication.  

Although, you can still use your Company authentication using an email, username and password inputs or social logins like Facebook or GooglePlus for the initial registration, but it is without of doubt unusual.

It's of better experience for the users if the initial registration for an account is of no user intervention. Increasing the chances of users engaging in trying out an application.

Once registered, the user can add more login methods a.k.a. switch account methods by binding or syncing more authentication methods through the Sync Manager plugin.

The more authentication methods are bonded into a user account, the more the switch accounts a.k.a. authentication login alternatives are able to be made.

In conclusion, the Authentication and Sync Manager are plugins that make up the account system authentication of the PlayFab Master Collection. It works on almost all popular platforms, supports account binding sync and switching.

Ideally, a zero intervention initial registration of an account is ideal for the creation of an account user. For mobile, using the device id. And for the web, a custom id of which is ideally generated using cryptographic means. Although, it's not mandatory.

Account registration is done through the Authentication plugin. After initial registration, a user can add more authentication methods using the Sync Manager plugin. The more authentication methods added, the more account login methods a user can use to access the account using the Authentication plugin.

Actions, Conditions & Expressions

Actions

Actions.png

Company Authentication

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

    • Key - Depending on the method. The Key will 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 extracted and input into this parameter from the Authentication plugin.

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

    • 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 Mobile GooglePlus addon from the Mobile Master Collection to access the Android GooglePlus SDK or iOS GooglePlus SDK. This is where the authentication is implemented and if successful, a ServerAuthCode can then be extracted and input into this parameter from the Authentication plugin.

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

Conditions

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.

Expressions

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.

Android Device Login

  • getAndroidNewlyCreated - Return True if newly created or False if a simple login, from the Android Device Login.

  • getAndroidPlayFabID - Return the PlayFabID from the Android Device Login.

  • getAndroidSessionTicket - Return the Session Ticket from the Android Device Login.

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.

Company Authentication

Sample Game Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Game Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Facebook Authentication

Sample Game Project

Dependencies​:

  • Mobile Facebook - requirement for mobile.

  • Web Facebook - requirement for web.

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Mobile  Implementation

Web Implementation

Supporters

Only

Google Plus Authentication

Sample Game Project

Dependencies​:

  • Mobile GooglePlus - requirement for mobile.

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Custom ID Authentication

Sample Game Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Mobile Device Authentication

Sample Game Project

Dependencies​:

  • Mobile Info - requirement for mobile.

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

 
 

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information: