---
title: Step 2. Configure the sample app
description: Guides you through configuring the DaVinci Android sample app in Android Studio by setting the OIDC client ID, scopes, redirect URI, and discovery endpoint.
component: orchsdks
page_id: orchsdks:davinci:try-it-out/android/02_configuring-sample-for-davinci
canonical_url: https://developer.pingidentity.com/orchsdks/davinci/try-it-out/android/02_configuring-sample-for-davinci.html
revdate: Fri, 17 Oct 2025 14:50:55 +0100
keywords: ["DaVinci", "Android", "Configure", "Sample App", "Android Studio", "OIDC"]
---

# Step 2. Configure the sample app

[icon: circle-check, set=far]PingOne [icon: android, set=fab]Android

* [Prepare](00_before-you-begin.html)

* [Download](01_downloading-forgerocksdk.html)

* **Configure**

* [Run](03_running-sample-pingone.html)

In this step, you configure the kotlin-davinci sample to connect to the OAuth 2.0 application you created in PingOne.

1. In Android Studio, open the `sdk-sample-apps/android/kotlin-davinci` project you cloned in the previous step.

2. In the Project pane, switch to the Android view.

   ![android studio android view en](../../../_images/android-studio-android-view-en.png)Figure 1. Switching the project pane to Android view.

3. In the Android view, navigate to **davinci > kotlin+java > com.pingidentity.samples.app**, and open `EnvViewModel.kt`.

4. Edit the placeholder values provided in the `testConfig` object with the values from your PingOne server:

   `testConfig` object placeholder values

   ```kotlin
   val testConfig by lazy {
       DaVinci {
           logger = Logger.STANDARD

           // Oidc as module
           module(Oidc) {
               clientId = "<Client ID>"
               discoveryEndpoint = "<Discovery Endpoint>"
               scopes = mutableSetOf("<scope1>", "<scope2>", "…​")
               redirectUri = "<Redirect URI>"
               display = "Test config"
           }
       }
   }
   ```

   * *clientId*

     The client ID from your OAuth 2.0 application in PingOne.

     For example, `6c7eb89a-66e9-ab12-cd34-eeaf795650b2`

   * *discoveryEndpoint*

     The `.well-known` endpoint from your OAuth 2.0 application in PingOne.

     > **Collapse: How do I find my PingOne .well-known URL?**
     >
     > To find the `.well-known` endpoint for an OAuth 2.0 client in PingOne:
     >
     > 1. Log in to your PingOne administration console.
     >
     > 2. Go to **Applications > Applications**, and then select your OAuth 2.0 client.
     >
     >    For example, sdkPublicClient.
     >
     > 3. On the **Overview** tab, expand the **Connection Details** section, and then copy the **OIDC Discovery Endpoint** value.
     >
     >    ![Locating the .well-known URL in a PingOne client profile.](../../../_images/p1-client-well-known.png)

     For example, `https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration`

   * *scopes*

     The scopes you added to your OAuth 2.0 application in PingOne.

     For example, `"openid", "profile", "email", "phone"`

   * *redirectUri*

     The `redirect_uri` as configured in the OAuth 2.0 client profile.

     This value must exactly match a value configured in your OAuth 2.0 client.

     For example, `com.example.demo://oauth2redirect`

   The result resembles the following:

   `testConfig` class example values

   ```kotlin
   val testConfig by lazy {
       DaVinci {
           logger = Logger.STANDARD

           // Oidc as module
           module(Oidc) {
               clientId = "6c7eb89a-66e9-ab12-cd34-eeaf795650b2"
               discoveryEndpoint = "https://auth.pingone.com/3072206d-c6ce-ch15-m0nd-f87e972c7cc3/as/.well-known/openid-configuration"
               scopes = mutableSetOf("openid", "profile", "email", "phone")
               redirectUri = "com.example.demo://oauth2redirect"
               display = "Test config"
           }
       }
   }
   ```

5. Copy your values from the `testConfig` object to the `prodConfig` object.

   |   |                                                                                                                                                                                     |
   | - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | You can use the details of a different PingOne instance, or OAuth 2.0 client in the `prodConfig` object.The only requirement is that the `discoveryEndpoint` values are valid URLs. |

6. Save your changes.
