Unauthorized Tenant

Hi,

I'm getting Unauthorized tenant error even after using my reset tenant password in body json.

Help me out as to why I'm getting that specific error, due to this I'm not able to access the token.

Answers

  • Roger K
    Roger K E mod
    edited October 16, 2023 #2
    1. When debugging tenant access issues its best to start with client_credentials grant. So first confirm you can get an access token using the client_id and secret only using client cred grant.
      Once you have proved you can get an access token this way you can move on to addressing any user access issues.
    2. When doing any level of user authorization with the tenant then the user needs to be a member of the subscription. So for Standalone apps this means a user of the IMS subscription which corresponds to your app and for Extension apps a member of the subscription being extended, e.g. Core Content. You can check the users for an application under the Apps>Users menu option within the tenant context of the tenant concerned.
    3. The easiest access to test using something like Postman is using password grant flow. This will require you to provide a username and password in addition to the client_id, secret and grant_type. So
      POST https://{{api_host}}/tenants/{{tenant_id}}/oauth2/token with the following RAW JSON body or equivelent xform url encoded:
      {"client_id": "{{app_confclient_id}}", "client_secret": "{{app_confclient_secret}}", "grant_type": "password", "username": "{{tenant_uid}}, "password": {{tenant_acc_pwd}}" }
    4. The important thing to note is that even if using a tenant user with the same email address as your developer account on developer.opentext.com, the password is not the same - it is the tenant password for that user. You can reset this for a tenant admin user via the admin center under the account icon when within the tenant context for the tenant concerned.