---
title: Step 4. Test the app
description: Prepare
component: sdks
version: latest
page_id: sdks:oidc:tutorials/javascript/aic/04_test_the_app
canonical_url: https://docs.pingidentity.com/sdks/latest/oidc/tutorials/javascript/aic/04_test_the_app.html
revdate: Wed, 16 Oct 2024 14:10:20 +0100
keywords: ["OAuth 2.0", "OpenID Connect", "Tutorial", "Source Code", "Integration", "SDK", "JavaScript"]
section_ids:
  run_the_sample: Run the sample
  recap: Recap
  more_information: More information
---

# Step 4. Test the app

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

* [Download](01_download-sample-repo.html)

* [Install](02_install-dependencies.html)

* [Configure](03_configure_connection_properties.html)

* **Run**

***

In the following procedure, you run the sample app that you configured in the previous step.

The sample connects to your PingOne Advanced Identity Cloud tenant to obtain the correct URIs to authenticate the user, and redirects the browser to your PingOne Advanced Identity Cloud tenant.

After authentication, PingOne Advanced Identity Cloud redirects the browser back to your application, which then obtains an OAuth 2.0 access token and displays the related user information.

## Run the sample

1. In a terminal window, navigate to the `/javascript` folder in your `sdk-sample-apps` project.

2. To run the embedded login sample, enter the following:

   ```shell
   npm run start:central-login-oidc
   ```

3. In a web browser, navigate to the following URL:

   `https://localhost:8443`

   The sample displays a page with two buttons:

   ![Running the central login app](../../../../_images/js-central-sample-page-1-en.png)

4. Click Login.

   The sample app redirects the browser to your PingOne Advanced Identity Cloud instance.

   |   |                                                                                                                                                                                                                               |
   | - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | To see the application calling the `authorize` endpoint, and the redirect back from PingOne Advanced Identity Cloud with the `code` and `state` OAuth 2.0 parameters, open the Network tab of your browser's developer tools. |

5. Authenticate as a known user in your PingOne Advanced Identity Cloud tenant.

   After successful authentication, PingOne Advanced Identity Cloud redirects the browser to the client application.

   If the app displays the user information, authentication was successful:

   ![Successful OAuth 2.0 authentication](../../../../_images/aic-am-oidc-login-userinfo.png)

6. To revoke the OAuth 2.0 token, click the Sign Out button.

   In this tutorial, PingOne Advanced Identity Cloud redirects users back to the client application, ready to authenticate again.

## Recap

Congratulations!

You have now used the Ping (ForgeRock) SDK for JavaScript to obtain an OAuth 2.0 access token on behalf of a user from your PingOne Advanced Identity Cloud tenant.

You have seen how to obtain OAuth 2.0 tokens, and view the related user information.

## More information

* [API reference: `TokenManager`](https://developer.pingidentity.com/reference/sdks/javascript/api-reference-core-4-9/classes/token-manager.TokenManager.html)

* [API reference: `UserManager`](https://developer.pingidentity.com/reference/sdks/javascript/api-reference-core-4-9/classes/user-manager.UserManager.html)
