I am trying to add user to a tenant. For that I did the following:
- Created tenant in WSO2 instance
- Generated access token based on client key and secret for the tenant service provider
- Use generated token to execute endpoint https://localhost:9443/t/carbon.super/{tenantId}/api/server/v1/scims2/Users, where tenantId is id of the tenant.
After executing the endpoint, I am getting error 401 Unauthorized. Any ideas what am I doing wrong?
I am not sure if it's relevant, but I noticed that when I generate access token from main WSO2 instance (not tenant), I get these scopes
"scope": "internal_list_tenants internal_user_mgt_create"
However, when I generate similar token with tenant client key and secret, with the same scopes, I see only
"scope": "internal_user_mgt_create"
I suppose this is fine because createUser only needs this scope, but may be 401 comes from inability to get tenant that is needed with internal_list_tenants scope?