SSO

The SSO login validates a single user (player) against the playPORTAL. Players may log in with a valid playPORTAL set of credentials. If they've previously logged in, then they can continue to operate as a logged in user.

The PPconfigure method is used to initiate this process. In conjunction with your UserListener function, the app can either:

  • if user is currently un-authorized, log a user in via SSO, and then allow full use of the playPORTAL SDK

  • if user is currently authorized, silently log in (no user interaction) and then allow full use of the playPORTAL SDK

To support this process, first define a UserListener function that will be invoked on change of Auth status.

export const UserListener = (u, authUpdate) => {
console.log("UserListener invoked on user:", JSON.stringify(userprofile) +" auth status:"+ authUpdate);
authenticated = authUpdate;
if(authenticated == true) {
userprofile = u; // save user profile for display, etc
} else {
// display modal with login button or redirect to SSO login
ssoUrl = PPgetLoginRoute(); // URL for SSO login is here
}
}

Then, configure the SDK. The parameters are as described previously. This call does the configuration and starts the auth process. The UserListener will be invoked with auth status.

PPconfigure(cid, cse, redir, ["SANDBOX" | "PRODUCTION"]); // last parm, environment is optional. defaults to "SANDBOX"