Step 4. Test the app
In the following procedure, you run the sample app that you configured in the previous step. The sample connects to your server and walks through the authentication journey you created in an earlier step.
After successful authentication, the sample obtains an OAuth 2.0 access token and displays the related user information.
-
In a terminal window, navigate to the
sdk-sample-apps/javascriptfolder. -
Use
npmto run the sample:npm run start:reactjs-todo-dv -
Ensure you are NOT currently logged into the PingOne instance.
If you are logged into the PingOne instance in the browser, the sample will not work.
Logout of the PingAM instance before you run the sample.
-
In a web browser, navigate to the URL on which you are running the sample, including the port number you specified in your
.envfile.For example,
https://localhost:8443The app renders a home page explaining the purpose of the project:
Figure 1. The first page of the JavaScript DaVinci client sample. -
Click Sign In.
The app displays the first nodes from your selected DaVinci flow:
Figure 2. The first nodes of the DaVinci flow. -
Enter your credentials and then click Sign On.
Upon successful authentication, the app obtains the user’s details and displays a message containing their name on the screen:
Figure 3. The app displays user info after successful authentication. -
Optionally, if you configured the TODO API backend server, you can click Todos to view and manage todo items for the user.
Figure 4. If you configured the API backend, you can view, edit, update, and delete todo items. -
To sign out of the application and revoke tokens, click the user icon, and then click Sign Out.
Figure 5. Sign out to close the session and revoke tokens.The app returns to the home page after signing out and revoking the tokens.