PlayPortalAuthClient

This class is responsible for authenticating users into your app.
public sealed class PlayPortalAuthClient

The PlayPortalAuthClient class is the entry point for users into your app. You will use this class to authenticate users by their playPORTAL username and password.

A user may skip the authentication flow and sign in as a "Guest User" if they do not have a playPORTAL account. To include this feature in your app, you must have a screen for the user to enter their date of birth that does not have a back button option. For more information, see createAnonymousUser.

Properties

public static readonly PlayPortalAuthClient Instance;

Singleton instance of PlayPortalAuthClient. You will access all the available PlayPortalAuthClient methods via this field.

Methods

Login

public void Login(string handle, string password, Action<Exception, PlayPortalProfile> completion)

Log a user into your app using their playPORTAL credentials.

This method uses the "Basic Auth" API and therefore requires your app to have "Basic Auth" enabled. Please send an email to accounts@playportal.io and we will authorize your app.

Parameter

Type

Description

handle

string

The user's playPORTAL profile handle.

password

string

The user's playPORTAL profile password.

completion

Action<Exception, PlayPortalProfile>

The delegate invoked when the request finishes. Called with an Exception argument if the request fails; otherwise, called with an instance of PlayPortalProfile representing the logged in user.

Logout

public void Logout(Action<Exception> completion)

Logout the currently authenticated user from your app.

Parameter

Type

Description

completion

Action<Exception>

The delegate invoked when the request finishes. Called with an Exception argument if the request fails.