Hello, I am currently trying to assign permissions for another api for a newly created client via management api.
Unfortunately, this is not working as I had imagined.
I am using C# in a .NET 7.0 project as well as the Auth0.ManagementApi NuGet package (v 7.23.1)
The creation of the application works without any problems though adding permissions to the custom api does not.
The code looks as following:
const string ApiId = "632450fa0c1d9c0ba3a00a30";
const string Scope = "someExistingScope";
[...]
var client = await client.UpdateAsync(
clientId.Value,
new ClientUpdateRequest {
ResourceServers = new[] {
new ClientResourceServerAssociation {
Identifier = ApiId,
Scopes = new[] { Scope }
}
}
},
cancellationToken);
The code runs without any problems. The result (client
) also looks correct so far as it contains the given resource server as well as the scope.
Also in the monitoring tab of the tenant interface everything looks like it worked as the raw json contains the resource server:
[...]
"resource_servers": [
{
"identifier": "632450fa0c1d9c0ba3a00a30",
"scopes": [
"someExistingScope"
]
}
],
[...]
However, when I click on the newly created M2M application in the web interface, neither the added api nor the scope assigned within the api is displayed.
I also looked up the resource server api endpoint but that one doesn’t look fitting at all.
Also I am quite confused as the documentation of the clients endpoint does not contain any resource server params at all but ClientUpdateRequest
from the NuGet package does.
Am I missing something? Is there another endpoint that I am supposed to use?
Thanks in advance