# Sample Delegated Authentication Authority Server

## Configuration Setup
1. Create a JSON file containing a list of Delegated Authentication Authority tokens.
2. Modify the host for Safetrust Credential Manager and the configuration path for Delegated Authentication Authority token in the `application.properties` file.

## How to run application
### Using Gradle
To run the application using Gradle, use the following command:
```bash
./gradlew bootRun
```
### Using the JAR file
To run the application using the JAR file, follow these steps:
1. Build the JAR file by executing the following command:
```bash
./gradlew clean build
```
After running this command, you can find the JAR file in the `build/libs` directory.
2. Run the JAR file:
#### Option 1: Execute the following command:
```bash
java -jar build/libs/DelegatedAuthenticationAuthority-0.0.1.jar
```
#### Option 2: Running the JAR file with external properties:
- Create a folder and place the JAR file and configuration files inside it. The folder structure should look like this:

```plaintext
sample-vendor-server-folder
│
├── application.properties
│
├── token
│ └── autority-tokens.json 
│
└── DelegatedAuthenticationAuthority-0.0.1-jar-with-dependencies.jar
```
- Navigate to the folder where you placed the JAR file and configuration files.
- Run the following command to execute the JAR file while specifying the classpath and the main application class:
```bash
java -cp :DelegatedAuthenticationAuthority-0.0.1-jar-with-dependencies.jar com.safetrust.auth.authority.DelegatedAuthenticationAuthorityApplication
```