# generate.go

Create interservice Request tokens that can be used to mimic a direct call from one service to another in localdev.

```sh
# from the project root
cd scripts/tokens
go run generate.go
```

This is primarily useful for testing/debugging an API manually.

The token is valid for 1 hour.

The generated token _does not_ contain any user data, the token behave as a system request instead of a user request.

Example claims payload
```json
{
  "id": "1c4695f0-e6a1-4c25-a760-71d43352ab07",
  "iss": "localdev",
  "iat": 1614173108,
  "nbf": 1614173103,
  "exp": 1614176708,
  "sub": "00000000-0000-0000-0000-000000000000",
  "name": "@localdev",
  "email": "localdev@contiamo.com",
  "tenantID": "",
  "realmIDs": [
    "e473c1cc-598c-4a75-9a60-84f5dec53f9b"
  ],
  "groupIDs": [],
  "isTenantAdmin": false,
  "adminRealmIDs": [
    "e473c1cc-598c-4a75-9a60-84f5dec53f9b"
  ],
  "amr": [
    "test-token"
  ],
  "azp": "localdev"
}
```