public final class PlayPortalAuthClient
PlayPortalAuthClient class is the entry point in the SDK for your app. It's where you will configure the SDK to use your app's credentials (client id and secret), environment, and redirect URI. It's also used to authenticate users through the Single-Sign On flow, as well as log users out.
public static let shared: PlayPortalAuthClient
Singleton instance of
PlayPortalAuthClient. You will access all the available
PlayPortalAuthClient methods through this instance.
public func configure(forEnvironment environment: PlayPortalEnvironment, withClientId clientId: String, andClientSecret clientSecret: String, andRedirectURI redirectURI: String) -> Void
This method will configure the SDK for your app using your app's credentials (client id and secret), redirect URI, and the environment your app is using.
The client id for your app created in the developer dashboard.
The client secret for your app created in the developer dashboard.
The redirect URI registered for your app in the developer dashboard.
public func isAuthenticated(loginDelegate: PlayPortalLoginDelegate? = nil, _ completion: @escaping (_ error: Error?, _ userProfile: PlayPortalProfile?) -> Void -> Void
Checks if there is a playPORTAL user currently authenticated through the SDK. If not, your app will need to initiate the SSO flow.
An optional instance of
The closure that will be invoked after checking if there is an authenticated user. If there is an authenticated user, it will be invoked with an instance of
public func open(url: URL) -> Void
Extracts authentication tokens on a successful redirect. Your AppDelegate will need to implement
application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
and invoke this method, passing in the
public func logout() -> Void
Logout the currently authenticated user.