Skip to content

Latest commit

 

History

History
90 lines (59 loc) · 2.34 KB

Setup.md

File metadata and controls

90 lines (59 loc) · 2.34 KB

How to Run the OAuth Agent Locally

Follow the below steps to get set up for developing and testing the OAuth Agent itself.

Prerequisites

Ensure that these tools are installed locally:

Also get a license file for the Curity Identity Server:

Update your Hosts File

Ensure that the hosts file contains the following development domain names:

127.0.0.1  api.example.local login.example.local
:1 localhost

Understand URLs

For local development of the OAuth Agent the following URLs are used, with HTTP to reduce development infrastructure:

Component Base URL Usage
OAuth Agent http://api.example.local:8080/oauth-agent This acts as a Back End for Front End for SPAs
Curity Identity Server http://login.example.local:8443 This will receive a string client secret from the OAuth Agent

Build and Run the OAuth Agent

Run these commands from the root folder and the API will then listen on HTTP over port 8080:

npm install
npm start

Test that the API is contactable by running this command from the root folder:

curl -X POST http://api.example.local:8080/oauth-agent/login/start \
-H "origin: http://www.example.local" | jq

Run Integration Tests

Run some tests that require only a running OAuth Agent, with a mocked Identity Server:

npm run wiremock
npm test

Run End-to-End Tests

Run some tests that also use the Curity Identity Server.
First copy a license.json file into the test/end-to-end/idsvr folder and then run the following command:

./test/end-to-end/idsvr/deploy.sh

Ensure that the OAuth Agent is running:

npm start

Then run a test script that uses curl requests to verify the OAuth Agent's operations:

./test/end-to-end/test-oauth-agent.sh

API Tests

Free Docker Resources

When finished with your development session, free Docker resources like this:

./test/idsvr/teardown.sh