Create AppToken by API

Hi,
is it possible to create an identical AppToken within multiple instances of PSU? This would make it easier to connect to e.g. the integration and production instance…

I’ve already tried to create one by API POST /api/v1/apptoken… The API call succeeds but the created token is “invalid” if I use it in the API again.

Product: PowerShell Universal
Version: 1.5.21

This seems like a bug with the POST endpoint. I’ll open an issue for this to see if we can get that fixed.

Can you share your HTTP calls? I tried this locally and can’t reproduce it.

PUT  {{baseUrl}}/apptoken
content-type: {{contentType}}
Authorization: Bearer {{appToken}}

{
  "id": 7,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiRGVmYXVsdCBBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2hhc2giOiI4NGUzYmIzMi1hMzU1LTQ4MjMtOTNhNi01YzRmNjliYTc5ZWMiLCJzdWIiOiJQb3dlclNoZWxsVW5pdmVyc2FsIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW5pc3RyYXRvciIsIm5iZiI6MTYyNjA3NDMzNCwiZXhwIjoxNjI4NjY2MzM0LCJpc3MiOiJJcm9ubWFuU29mdHdhcmUiLCJhdWQiOiJQb3dlclNoZWxsVW5pdmVyc2FsIn0.SPer4mhQhuc_l9dE5uZj03T7XuVGYlaRdMnERiay#Pg",
  "identity": {
    "id": 1,
    "name": "Default Admin",
    "source": 0,
    "role": null,
    "roleName": null
  },
  "revoked": false,
    "role": "Administrator",
    "created": "2021-07-12T09:18:54.898+02:00",
    "expiration": "2021-08-11T09:18:54.881+02:00",
    "revokedDate": "0001-01-01T00:00:00",
    "createdBy": {
      "id": 1,
      "name": null,
      "source": 0,
      "role": null,
      "roleName": null
    }
  }
}