Skip to main content

3rd-party Logins

About

This document provides step-by-step instructions for enabling Google and Apple sign-in for ESP RainMaker users. It covers setting up OAuth credentials in the Google API Console and Apple Developer Console, configuring authentication settings in AWS Cognito, and integrating these identity providers with the ESP RainMaker Dashboard. Additionally, it includes steps to verify successful integration using Cognito’s Hosted UI and details on enabling Apple’s private email relay for enhanced privacy.
For detailed steps, refer to Sign in with Google, Sign in with Apple or Sign in with Wechat.
Please select the relevant tab below to make the link above clickable.


Sign in with Google (Optional)

End users can log in to RainMaker mobile apps with their Google accounts.

This section describes the steps required to configure the Google sign-in for end users.

Prerequisites


  1. A Google developer account is created. (Reference: https://console.developers.google.com/)
  2. ESP-RainMaker-Core is deployed.
  3. A custom domain is created. (Reference: Configure Customer Domain)

Steps to Configure Google App Client

Configurations in Google Developer Account


  • Sign in to the Google API Console with your Google developer account credentials using the URL
    https://console.developers.google.com/.

  • When you login to the Google Developer console, below screen is displayed.

Google Developer Console

  • To create a Google API Console project, Click ▼ found at top left title bar next to the list of projects, as shown below.

  • Click NEW PROJECT at the top right corner.

Google API Console Project

  • Enter a Project name and click CREATE.

Google Project Creation

After the project is created, you will need to configure the OAuth consent screen. The steps for configuring OAuth consent are provided below.

Note: You are required to configure the newly created project. If you have multiple projects in your Google developer account, select the newly created project, from the list of projects by clicking ▼ found at top left title bar.

  • In the Google API Console, in the left navigation pane, click OAuth consent screen.

Google API Console

  • Select User Type as External and click CREATE.

Google OAuth Consent Screen

  • Enter App name and User support email, under App information. You may enter Application Home Page, Application Privacy Link, Application Terms of Service Link, but these are optional.

Google OAuth Consent Screen

  • Under Authorized domains, click ADD DOMAIN.

Google Authorized Domain

  • Enter amazoncognito.com for the domain name as shown below.

Google Authorized Domain

  • Under Developer contact information, enter a valid email address for the developer contact information.

Contact Information

  • Click SAVE AND CONTINUE.

Save Details

  • Next, click SAVE AND CONTINUE.

Optional info

  • Review the changes and click BACK TO DASHBOARD.

Review changes

  • Next step is to get OAuth 2.0 client credentials. In the Google API Console, in the left navigation pane, click Credentials.

Credentials

  • Click + CREATE CREDENTIALS and select OAuth client ID as the option.

Credentials

  • Choose Application type as Web Application.

Create OAuth Client ID

  • Enter a Name for your OAuth client.
  • For Authorized JavaScript origins, click ADD URI.

Authorized Javascript origins

Standard RainMaker vs OAuth-only RainMaker

Standard RainMaker

  • Enter your Amazon Cognito domain https://<your-company-domain>.auth.<aws-region>.amazoncognito.com as shown below.
    This is taken from Configure Cognito Domain.

OAuth-only RainMaker

  • Enter your HTTP Base URL (without stage)
  • Example: https://<API gateway Id>.execute-api.<AWS-Region>.amazonaws.com

Cognito Domain

  • For Authorized redirect URIs, click Add URI.

Add authorized redirect URI

Standard RainMaker vs OAuth-only RainMaker

Standard RainMaker

  • Enter your Amazon Cognito domain
    https://<your-company-domain>.auth.<aws-region>.amazoncognito.com/oauth2/idpresponse as shown below.
    This is taken from Configure Cognito Domain.
reminder

Remember to add /oauth2/idpresponse behind your custom Cognito domain.


OAuth-only RainMaker


:::

Add authorized redirect URI

  • Click CREATE button.

  • In the OAuth client dialog, find the client ID and client secret, and then note them for later use.

OAuth Client Dialog

Google web app client is configured successfully!

Configure Google as Identity Provider via the RainMaker Dashboard


  • Log in to RainMaker Dashboard with your admin account. Go to Deployment Settings.

Dashboard Deployment Settings

  • Go to the Identity Providers tab.

Identity Providrs

  • Click + icon to add Identity providers configuration.

  • Choose Google from Identity Provider dropdown.

  • Add Client ID and Client Secret noted in the previous step.

Identity Providers

Enable Google as an Identity Provider

info

This feature is not relevant for OAuth-only RainMaker.

  1. Log in to RainMaker Dashboard with your admin account. Go to Deployment Settings.

Dashboard Deployment Settings

  1. Go to the Identity Configurations tab.

Cognito Config

  1. Enable the google identity provider for clients as per your requirements. This will enable users to sign in using Google to the respective clients.

Configuring callback URL (Redirect URIs)

Callback URL indicates where the user is to be redirected after a successful sign-in using third party authenticating services. After the user successfully signs-up using one of these third party authenticating services, the user will be redirected to one of these URLs.

If users are to be redirected to your phone app, you should form the callback URL for your app. To form the callback URLs (redirect URIs) for phone apps, please check below sections:

Configure the callback URLs in RainMaker dashboard with steps given here: Configure Cognito Callback URL.

Verifying Sign-in With Google

info

This feature is not supported for OAuth-only RainMaker yet.


This section describes the steps to verify if the Sign-in with Google is configured correctly.

  • Log in to AWS Console, go to Amazon Cognito > User pools, and get the list of all user pools.

Verifying Sign-in with Google

  • Click rainmaker-user-email-mobile-pool.

Verifying Sign-in with Google

  • Go to App integration > App Client Lists.

Verifying Sign-in with Google

  • Click rainmaker-user-email-mobile-pool-client, here you will get the App client information.

Verifying Sign-in with Google

  • Scroll down and click View Hosted UI.

Hosted UI

  • In the launched hosted UI, you will be shown multiple options as shown below:

Hosted UI

  • Click Continue with Google.

Hosted UI

  • Enter Your email address and the password.

Hosted UI

  • After you click the Next button, you will be redirected to the callback URL configured in the Cognito App client settings and you will see an authorization code in the browser URL.

Hosted UI

Note: In this example, we have configured Espressif’s home page, so the redirection happened to this page.


Sign in with Apple (Optional)

The end users can log in to RainMaker mobile apps with their Apple accounts.
This section describes the steps required to configure the Apple sign-in for the end users.

Prerequisites


  1. Apple developer account is already created, and developer program enrollment is completed. (Reference: https://developer.apple.com/programs/enroll/)
  2. ESP-RainMaker-Core is deployed.
  3. Custom domain is created. (Reference: Configuring custom domain)

Steps to Configure Apple Sign In

Configurations in Apple Developer Account


  1. Create an App ID from Apple Developer console, if not created already.

  2. Click Keys in the left section.

  3. Click the + button to add a new key.

Register AppId

  1. Provide a Key Name and select Sign in with Apple.

Register AppId

  1. Click Configure on the right of Sign in with Apple.

  2. Select your Primary App ID. Primary App ID should be of format "<teamId>.<bundleId>". Team ID and Bundle ID were noted down in step 1.

Register AppId

  1. Click Save to save the configurations.

  2. On Register a New Key page, click Continue.

  3. Review the configuration. Click Register to create a new key.

  4. Take note of Key ID and download the key file. This will be required while configuring Apple as identity provider via RainMaker dashboard.

  5. Click Identifiers, then click + button.

Apple Identifiers

  1. Select Service IDs from the list, then Continue.

ServiceId

  1. On the Register a Services ID page, select the Sign in with Apple checkbox to enable the service, and then select Configure.

  2. Provide an Identifier and Description for your service.

Service Config

  1. Take a note of identifier (Services ID). Services ID will be required while configuring Apple as Identity Provider via RainMaker Dashboard.

  2. Click Register to register Services ID.

Service Config

  1. After registration, go back to Identifiers. Click the service ID that you have registered in the step above.

  2. Enable Sign In With Apple and click the Configure button

Service Config

  1. Configure your domain.
Standard RainMaker or OAuth-only RainMaker

Standard RainMaker

  • Enter your Amazon Cognito domain https://<your-company-domain>.auth.<aws-region>.amazoncognito.com as shown below.
    This is taken from Configure Cognito Domain.

OAuth-only RainMaker

  1. Return URLs.
Standard RainMaker or OAuth-only RainMaker

Standard RainMaker

  • Enter your Amazon Cognito domain:
    https://<your-company-domain>.auth.<aws-region>.amazoncognito.com/oauth2/idpresponse as shown below.
    This is taken from Configure Cognito Domain.
reminder

Remember to add /oauth2/idpresponse behind your custom Cognito domain.


OAuth-only RainMaker

  • Get your HTTP API Endpoint.
  • Redirect URI: {HTTP API Endpoint}/cognitocallback. The domain here should be the one created in AWS Cognito. The return URL should be https://&lt;domain&gt;/oauth2/idpresponse.

:::

Website URLs

Configure Apple as Identity Provider via the RainMaker Dashboard


  1. Log in to RainMaker Dashboard with your admin account. Go to Deployment Settings.

Dashboard Deployment Settings

  1. Go to the Identity Providers tab.

Identity Providers

  1. Click the + icon to add Identity providers configuration.
  2. Choose SignInWithApple from Identity Provider dropdown.
  3. Provide Client ID (i.e., services ID noted in step 15 of Configurations in Apple Developer Account section).
  4. Enter "Apple" as Provider Name.
  5. Provide Key ID noted in step 1 and 10 of Configurations in Apple Developer Account section.
  6. Provide Team ID noted in the step 1, Creating App ID.
  7. Provide content of Private Key file downloaded in step 10 of Configurations in Apple Developer Account section.

Identity Providers

Enable Apple as an Identity Provider

notice

This is not relevant for OAuth-only RainMaker.

  1. Log in to RainMaker Dashboard with your admin account. Go to Deployment Settings.

Dashboard Deployment Settings

  1. Go to the Cognito Configurations tab.

Cognito Config

  1. Enable the signinwithapple identity provider for clients as per your requirements. This will enable users to sign in using Apple to the respective clients.

Configure callback URL (Redirect URIs)

Callback URL indicates where the user is to be redirected after a successful sign-in using third party authenticating services. After the user successfully signs-up using one of these third party authenticating services, the user will be redirected to one of these URLs.

If users are to be redirected to your phone app, you should form the callback URL for your app. To form the callback URLs (Redirect URLs) for iOS app, please check Creating Redirect URL.

Configure the callback URLs in RainMaker dashboard with steps given here: Configure Cognito Callback URL.

Verifying Sign-in With Apple


notice

For OAuth-only RainMaker, refer these steps instead.

This section describes the steps to verify if the Sign-in with Apple is configured correctly.

  • Log in to AWS Console, go to Amazon Cognito > User pools, and get the list of all user pools.

Verifying Sign-in with Google

  • Click the rainmaker-user-email-mobile-pool.

Verifying Sign-in with Google

  • Go to App integration > App Client Lists.

Verifying Sign-in with Google

  • Click rainmaker-user-email-mobile-pool-client, here you will get the App client information.

Verifying Sign-in with Google

  • Scroll down and click View Hosted UI.

Hosted UI

  1. In the launched Hosted UI, you will be shown multiple options as shown below:

Hosted UI

  1. Click Continue with Apple.

  2. Enter your Apple ID and the password.

  3. After you click the Next button, you will be redirected to the callback URL configured in the Cognito App client settings and you will see an authorization code in the browser URL.

Hosted UI

Note: In this example, we have configured Espressif’s home page, so the redirection happened to this page.

Email Relay Service

Apple’s private email relay service is used by privacy-conscious users that keep their personal email address private when setting up an account. In order to send email messages through the relay service to these users, you will need to register your outbound email domains, subdomains, or email addresses. All registered domains must create Sender Policy Framework (SPF) DNS TXT records in order to transit Apple’s private mail relay.

To check if your organization email domain has an SPF record:

  1. Go to https://dnschecker.org/spf-record-validation.php.
  2. Enter you email domain and click validate.
  3. You would see the output as below as you scroll down. This means that the SPF record exist for your email domain. SPF Record

Steps to add a Domain:

  1. In Certificates, Identifiers & Profiles, select More from the sidebar, and click Configure Sign in with Apple for Email Communication.
  2. In the Email Sources section, click the + button in the upper-left corner.
  3. Enter a comma-delimited list of domains, subdomains and unique email addresses that will be used for email communication and click Next.
  4. Confirm your entered email sources and click Register.
  5. The below table will display if the registered email source passed an SPF check.

Private Relay Email/Domain Added


On this page