C# Class AuthenticationValues

Container for user authentication in Photon. Set AuthValues before you connect - all else is handled.
On Photon, user authentication is optional but can be useful in many cases. If you want to FindFriends, a unique ID per user is very practical. There are basically three options for user authentification: None at all, the client sets some UserId or you can use some account web-service to authenticate a user (and set the UserId server-side). Custom Authentication lets you verify end-users by some kind of login or token. It sends those values to Photon which will verify them before granting access or disconnecting the client. The Photon Cloud Dashboard will let you enable this feature and set important server values for it. https://www.exitgames.com/dashboard
Mostra file Open project: daniel-cheng/stellar Class Usage Examples

Public Methods

Method Description
AddAuthParameter ( string key, string value ) : void

Adds a key-value pair to the get-parameters used for Custom Auth.

This method does uri-encoding for you.

AuthenticationValues ( ) : System

Creates empty auth values without any info.

AuthenticationValues ( string userId ) : System

Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType.

SetAuthPostData ( byte byteData ) : void

Sets the data to be passed-on to the auth service via POST.

SetAuthPostData ( string stringData ) : void

Sets the data to be passed-on to the auth service via POST.

ToString ( ) : string

Method Details

AddAuthParameter() public method

Adds a key-value pair to the get-parameters used for Custom Auth.
This method does uri-encoding for you.
public AddAuthParameter ( string key, string value ) : void
key string Key for the value to set.
value string Some value relevant for Custom Authentication.
return void

AuthenticationValues() public method

Creates empty auth values without any info.
public AuthenticationValues ( ) : System
return System

AuthenticationValues() public method

Creates minimal info about the user. If this is authenticated or not, depends on the set AuthType.
public AuthenticationValues ( string userId ) : System
userId string Some UserId to set in Photon.
return System

SetAuthPostData() public method

Sets the data to be passed-on to the auth service via POST.
public SetAuthPostData ( byte byteData ) : void
byteData byte Binary token / auth-data to pass on.
return void

SetAuthPostData() public method

Sets the data to be passed-on to the auth service via POST.
public SetAuthPostData ( string stringData ) : void
stringData string String data to be used in the body of the POST request. Null or empty string will set AuthPostData to null.
return void

ToString() public method

public ToString ( ) : string
return string