I’m trying to reach the endpoint “/odata/HostLicenses”, but I keep being met with the message “You are not authorized!” with errorCode 0.
I have created an external application which I have given access to the application scope “OR.Administration” as required. With the app secret and api key, I’ve retrieved a bearer token from the endpoint “/connect/token”, which I then use in the API call to “/odata/HostLicenses”.
Anyone who has had a similar problem and found a solution?
Hi @Frederik_Wrist_Krogh
As per the Swagger documentation your permissions seem to be correct.
Can you try running the API from Swagger directly since you have everything set and check if you are getting the same issue here as well? https://cloud.uipath.com/<org_ID>/<tenant_name>/orchestrator_/swagger/index.html#/HostLicenses/HostLicenses_Get
If you are still facing issues, then maybe try tweaking some permissions of your external application.
Yeah, its tricky to set up. Lets start at the beginning.
Show us a screenshot of your external app setup on the orchestrator, redact the application ID as you choose but please leave the scopes visible.
I’ve given the required permission to Administration/aAdministration.read, and then I’ve tried giving access to a few other scopes, quite randomly, in the hope of hitting the lucky one.
“/odata/HostLicenses” works for Host Tenant in Onpremise Stand-alone Orchestrator.
Swagger works only for the orchestrator instance (orchestrator tenant) you kept open in your bowser tab.
Host tenant in Onpremise orchestrator do not have External Apps section. You will have to use Local User Authentication via a Bearer Token (ROPC authentication) with Host Administrator credentials.