Your app needs an OAuth client ID to identify itself to Google's authentication backend. For iOS and apps, the OAuth client ID application type must be configured as iOS.
The app will also make calls to the Home APIs. To enable this functionality, the API must be enabled in the same Google Cloud project.
Generate the OAuth client ID
- In the Google Cloud console, go to the project selector dashboard and select the project that you want to use to create OAuth credentials.
- Go to the APIs and Services page by clicking on the menu button on the top left hand side > View All Products > APIs & Services.
- In the navigation menu, click Credentials.
If you haven't yet configured your consent screen for this Google Cloud project, the Configure consent screen button appears. In that case, configure your consent screen using the following procedure. If your OAuth consent screen has already been configured and its publishing status is Testing, ensure the test accounts you will use are added to the Test users group. Otherwise, move on to the next step.
- Depending on your use case, select Internal or External, and then click Create. The OAuth consent screen pane displays.
- Enter information on the App information page according to the on-screen instructions, and then click Save and continue. The Scopes pane displays.
- You don't need to add any scopes, so click Save and continue. The Test users pane displays.
- If you opted to create an internal consent screen, you must add users to test access to your app. Click Add users. The Add users pane displays. Test users have the privilege to grant permissions in your app. In the empty field, add one or more Google Account email addresses, and then click Add.
- Click Save and continue. The Summary pane displays.
- Review your OAuth consent screen information, and then click Back to dashboard.
On the left menu panel, click Credentials to create your OAuth client ID.
- Click the CREATE CREDENTIALS button, and select OAuth client ID.
- Under application type, select iOS.
- Enter the Bundle ID with your app identifier and Apple Developer Team ID. The other fields are optional and can be left blank.
- Click CREATE, and note the created Client ID or DOWNLOAD PLIST. This will be used later to enable permissions flow functionality. For more information, see the Create authorization credentials section.
- Click the CREATE CREDENTIALS button, and select OAuth client ID.
Enable the Home APIs
Enable access to the Home APIs.
- In the APIs and Services tab, click Enabled APIs & Services.
- Click ENABLE APIS AND SERVICES at the top of the page.
- Search for the
HOME API
and select it. - In the Home API detail page, click ENABLE.
If you have an existing OAuth client
If you already have a verified OAuth client for a published app, you can use your existing OAuth client to test the Home APIs.
Google Home Developer Console registration is not required to test and use the Home APIs. However, you will still need an approved Developer Console registration to publish your app, even if you have a verified OAuth client from another integration.
The following considerations apply:
There is a 100-user limit when using an existing OAuth client. For information about adding test users, refer to Generate the OAuth client ID. Independent of OAuth verification, there is a Home APIs-imposed limit of 100 users who can grant permissions to your application. This limitation is lifted upon completion of Developer Console registration.
Developer Console registration should be sent for approval when you are ready to restrict device-type grants through OAuth in preparation for updating your app with the Home APIs.
For Google Cloud apps that are still pending OAuth verification, users can't complete the OAuth flow until verification is complete. Attempts to grant permissions will fail with the following error:
Access blocked: <Project Name> has not completed the Google verification process.