| title | sidebar_label | description | hide_table_of_contents | sidebar_position |
|---|---|---|---|---|
Publisher Integration with SSO Providers |
Publisher SSO Integration |
Information for publishers for using single sign-on (SSO) providers with UID2. |
false |
6 |
import Link from '@docusaurus/Link';
If you integrate with one or more SSO providers to offer SSO login, you might be able to retrieve the logged-in user's email address from the SSO provider to generate UID2 tokens.
This guide provides technical information about how to do this, for publisher integrations with several popular SSO providers.
:::important You are responsible for ensuring that your use of email addresses to create UID2s is consistent with your UID2 agreement, your company’s privacy policy, and any other platform or third-party terms to which your company is subject. :::
To integrate with a single sign-on solution, the general steps are as follows:
-
Get an identity token from the SSO provider.
-
Extract the user's email address from the identity token.
-
Pass the user's email address to the UID2 publisher integration of your choice.
:::note To find out whether you have to apply normalization and encoding to the email address, or the integration does it for you, check the documentation for your UID2 publisher integration. :::
The following options are available for implementing Sign in with Google:
Follow the instructions in Create the Sign in with Google flow. Once the token has been validated, you can retrieve the email address by using the getEmail() method of the identity token payload.
To get an email address from Sign in with Google on iOS or macOS, retrieve it from the GIDGoogleUser object. For details, see Getting profile information.
Follow the instructions to verify the Google ID token on your server side, and then retrieve the user's email address from the email field of the ID token.
There are two ways to integrate Facebook Login with UID2: with an OpenID Connect (OIDC) token or without.
To get an email address from Facebook Login using an OIDC token on iOS:
-
Implement Facebook Login (for details, see Use Facebook Login in Your iOS App) and request the
emailpermission. -
Extract the user's email address from the OIDC authentication token: for example, by using the
Profilehelper class. For details, see OIDC Tokens in Facebook Login for iOS.
To get an email address from Facebook Login without using an OIDC token:
-
Request a user access token, specifying the
emailpermission. -
If the user has granted the
emailpermission, make a Graph API call to the/meendpoint, using the user access token, and specifyemailas one of the fields.
The following applications demonstrate how to integrate with Facebook Login:
The instructions for signing in with Apple are different for apps and websites.
Request authorization, making sure to request the email scope. For details, see Request Authorization with Apple ID.
If authentication succeeds, retrieve the user's email address from the email property of the ASAuthorizationAppleIDCredential object.
Refer to the section Handle the Authorization Response of the page Configure your webpage for Sign in with Apple.
To get an email address from an OpenPass integration:
-
Use the OpenPass API or one of the OpenPass SDKs to get an identity token.
-
Extract the user's email address from the
emailclaim of the identity token. For details, see OpenPass Authentication Tokens.