Angular - Node.js Sample App

CyberArk Identity API capabilities demonstration with Angular front-end and Node.js backed

This Sample Application showcases the capabilities of CyberArk Identity Widgets and also includes OpenID Connect playground with all possible grant flows. This app uses Nodejs backend and Angular JS frontend.

CyberArk Identity Tenant Configuration

If you don't have any existing CyberArk tenants, you can try a free trial tenant [here].(https://www.idaptive.com/free-trial)

Step 1: Create a role

  • To create a role refer here.
  • Ensure that User Management, Role Management Rights are added to the role under the Administrative Rights section.

Step 2: Setup an Authentication Profile

  • Set up an Authentication profile and add it to the policy under the Authentication Policies section. For more information, refer to here.

Step 3: Create a Policy

  • To create a policy, refer here.
  • Ensure that the above-created role is added to the policy.

Step 4: Setup an OpenID Connect Application

  1. Navigate to the CyberArk Admin portal and click Web Apps under the Apps section.
  1. Click Add Web Apps and navigate to the Custom section->Add OpenID Connect app.
  2. Open the OpenID Connect app created in the above step.
  3. In the Settings section add an ID of your choice for the Application ID.
  1. Navigate to Trust Section

    Enter client secret (E.g.: sample1234)

    • Add Resource application URL for the sample app.
http://localhost:2200/api/Resource
  1. Add the Redirect destinations for the sample app.
http://localhost:2200/api/RedirectResource

Based on your app configuration the URL configuration should be changed.

  • Setup Permissions for OpenID Connect.
    * Add the above-created role and provide Run permission to generate Tokens.

For more Information on OpenID Connect, refer to here .

Specify Trusted DNS Domains for API Calls

  • Include Web App Domain in Trusted DNS Domains for API Calls.
    • Navigate to Settings -> Authentication -> Security Settings -> API Security in the admin portal.
    • Add an entry under Trusted DNS Domains for API Calls.
localhost

Step 5: Create an Authentication Widget and configure it as follows.

  • Link the widget with the OpenID connect app created above.

Angular Node Sample App Deployment Guide

Step by step guide to setup sample app environment

Overview

This guide aims to help you in installing the prerequisite tools and deploying the Angular Node sample app.

Before you begin

Install NODE.js

  • Download the Node.js installer from https://nodejs.org/en/download/ and run the file(highly recommended to download 64-bit version).
  • Node.js installer includes the NPM package manager.
  • Ensure that the path of Node.js is configured into the system PATH environment variable.
  • Use the commands below to check Node.js installation.
  • Minimum version of node required is 16.15.0.
node -v
npm -v

Install JS SDK

  • Install SDK from here

Build and Run

Follow the steps below to Build and Run the Angular Node application.

Angular

  • Navigate to identity-sample-nodejs/angular folder.
cd angular
  • Install the dependencies.
npm i
  • Run the application.
npm start

Nodejs server Application

  • Navigate to identity-sample-nodejs folder.
  • Install the dependencies
npm i
  • Run the server as an administrator.
npm start

Now, you can use the environment for the Angular Node Sample App.

Open http://localhost:4200 and configure Settings to access web application.