Packagecom.distriqt.extension.gameservices.auth
Interfacepublic interface AuthUtil extends flash.events.IEventDispatcher

AuthUtil provides static utility methods to:



Public Properties
 PropertyDefined By
  isSupported : Boolean
[read-only] Returns true if the auth utility functions are supported on the current platform and service If this returns false then all other functions in this class will fail
AuthUtil
Public Methods
 MethodDefined By
  
clearToken(token:String):Boolean
Clear the specified token in local cache.
AuthUtil
  
getToken(scope:String, useLegacy:Boolean = false):Boolean
Gets a token or authorisation to be consumed by some other services on behalf of a specified user account.
AuthUtil
Events
 Event Summary Defined By
   Dispatched when there was an error retrieving the auth token AuthUtil
   Dispatched when the auth token was successfully retrieved after a call to GameServices.service.authUtil.getToken() data will contain the auth token string AuthUtil
Property Detail
isSupportedproperty
isSupported:Boolean  [read-only]

Returns true if the auth utility functions are supported on the current platform and service

If this returns false then all other functions in this class will fail


Implementation
    public function get isSupported():Boolean
Method Detail
clearToken()method
public function clearToken(token:String):Boolean

Clear the specified token in local cache.

Parameters

token:String — The token to clear

Returns
Boolean — true if the operation was started successfully and false if it's not supported
getToken()method 
public function getToken(scope:String, useLegacy:Boolean = false):Boolean

Gets a token or authorisation to be consumed by some other services on behalf of a specified user account. How the token can be consumed depends on the scope string provided. Note: this method requires substantial network IO and is run asynchronously off the UI thread For Google Play Services this will return the current players Google Authentication Token. For GameCenter this returns the Identity Verification Signature from either:

Parameters

scope:String — (optional) A string representing the authentication scope. To specify multiple scopes, separate them with a space (for example, "oauth2:scope1 scope2 scope3").
 
useLegacy:Boolean (default = false) — If true the legacy / deprecated implementation will be used.

Returns
Booleantrue if the operation was started successfully and false if it's not supported
Event Detail
auth:token:error Event
Event Object Type: com.distriqt.extension.gameservices.events.AuthUtilEvent
AuthUtilEvent.type property = com.distriqt.extension.gameservices.events.AuthUtilEvent.AUTH_TOKEN_ERROR

Dispatched when there was an error retrieving the auth token

auth:token:success Event  
Event Object Type: com.distriqt.extension.gameservices.events.AuthUtilEvent
AuthUtilEvent.type property = com.distriqt.extension.gameservices.events.AuthUtilEvent.AUTH_TOKEN_SUCCESS

Dispatched when the auth token was successfully retrieved after a call to GameServices.service.authUtil.getToken()

data will contain the auth token string