DXAuthClient
This class is responsible for configuring the SDK with your app's credentials, as well as authenticating your users.
The DXAuthClient
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.
A user may skip the SSO flow and sign in as a "Guest User" if they do not have a DX 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
Singleton instance of DXAuthClient
. You will access all the available DXAuthClient
methods through this instance.
Methods
configure
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.
This method must be called before using any other methods in the SDK.
Parameter | Type | Description |
forEnvironment |
| The |
withClientId |
| The client id for your app created in the developer dashboard. |
andClientSecret |
| The client secret for your app created in the developer dashboard. |
andRedirectURI |
| The redirect URI registered for your app in the developer dashboard. |
isAuthenticated
Checks if there is a DX user currently authenticated through the SDK. If not, your app will need to initiate the SSO flow.
Parameter | Type | Description |
loginDelegate |
| An optional instance of |
completion |
| 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 |
open
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 url
argument.
Parameter | Type | Description |
url |
| The |
logout
Logout the currently authenticated user.
Last updated