Follow the below steps to get set up for developing and testing the OAuth Agent itself.
Ensure that these tools are installed locally:
Also get a license file for the Curity Identity Server:
- Sign in to the Curity Developer Portal with your Github account.
- You can get a Free Community Edition License if you are new to the Curity Identity Server.
Ensure that the hosts file contains the following development domain names:
127.0.0.1 api.example.local login.example.local
:1 localhost
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 |
Run these commands from the root folder and the API will then listen on HTTP over port 8080:
dotnet build
dotnet run
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 some tests that require only a running OAuth Agent, with a mocked Identity Server:
./test.sh
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:
dotnet run
Then run a test script that uses curl requests to verify the OAuth Agent's operations:
./test/end-to-end/test-oauth-agent.sh
When finished with your development session, free Docker resources like this:
./test/idsvr/teardown.sh