C# Класс 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
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

AddAuthParameter() публичный Метод

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.
Результат void

AuthenticationValues() публичный Метод

Creates empty auth values without any info.
public AuthenticationValues ( ) : System
Результат System

AuthenticationValues() публичный Метод

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.
Результат System

SetAuthPostData() публичный Метод

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.
Результат void

SetAuthPostData() публичный Метод

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.
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string