Follow the below steps to get set up for developing and testing the OAuth Agent itself. This instruction will show you
how to set up the OAuth Agent together with an instance of the Curity Identity Server used as the Authorization Server.
Ensure that these tools are installed locally:
Get a community edition license file for 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:
Component | Base URL | Usage |
---|---|---|
OAuth Agent | http://api.example.local:8080/oauth-agent | This will act as a modern Back End for Front End for SPAs |
Curity Identity Server | http://login.example.local:8443 | This will receive a client secret from the OAuth Agent |
Run this command from the root folder and the API will then listen on SSL over port 8080.
Alternatively the API can be run in an IDE of your choice:
./gradlew bootRun
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
You can run Spock integration tests with the following command, which spin up an instance of the API.
Integration tests use Wiremock to mock responses from the Curity Identity Server and do not
need any external dependencies.
./gradlew test --rerun-tasks
Run some tests that also use the Curity Identity Server.
First copy a license file into the test/end-to-end/idsvr
folder and then run the following commands:
./test/end-to-end/idsvr/deploy.sh
Ensure that the OAuth Agent is running:
./gradlew bootRun
Then run a test script that uses curl requests to verify the OAuth Agent's operations:
./test/end-to-end/test-oauth-agent.sh