Token Authorization (OAuth)

Strix Cloud can be configured to use OAuth so that connections can be authorized by your own methods for the purposes of player account control.

See the OAuth RFC for more info on how OAuth works.

Enabling Authorization

You can enable OAuth by checking the Authorization enabled box and specifying your User Resource URL, User ID key, and Name key under the Options tab of your application page on the Strix Cloud website.

Strix Cloud settings for token authentication

Using Authorization

If OAuth is enabled for the application, Strix requires the InitializeStrixNetworkWithHttpAccessToken function be called to initialize Strix networking. This requires the key token received from your authorization provider after login. Strix will retrieve the resource server information from the settings you have specified on the Strix Cloud website and request a resource from this server.

The response from your resource server should be JSON with the following fields:

{
    "name" : "logged in user name",
    "userId" : 1
}

If it receives an http OK response, it will then set the current Room Member name property and an additional userId custom property to the values in the response. These values cannot be overwritten while the network is initialized. These represent the name and ID of the user with the http access token.

If it receives an http error response, connections to room servers will fail. The network should be stopped and started again, and connection retried.