OpenText API authentication failed.

dakdgdl
dakdgdl Member
edited January 16 in Thrust Services #1

Hi Guys.

I got all the details like TenantID, TenantUserName, TenantPassword, CLientId and ClientScecret.

Though I applied all those it failed the authorization.

Please check the attached screenshot.

Any advise on how to get it authorized.

Thanks.

«1

Answers

  • Karen Weir
    Karen Weir E Community Administrator
    edited January 16 #2

    Can you please confirm what Region you selected for your trial.

    Here is a Quick Start that may help:

  • Hi Karen…

    Thank you for responding..

    I used the "United States" region.

  • Also I'm using the 90 days free trial of "Services bundle".

  • Karen Weir
    Karen Weir E Community Administrator

    Thank you. In the authorization popup, please scroll to the top to find the US section:

    Then, refer to the Quick Start to continue:

    https://forums.opentext.com/forums/developer/discussion/312658/opentext-apis-quick-start-guide

  • I now regenerate the client and secret also.

    Then tried with the new Confidential credentials (clientid and secret).

    Still it is failing.

    My region I selected is US.

    Any reason I'm doing wrong..

  • When I used the top most section (US section as you said), it gave this error message.

    ======

    Error: Bad Request, error: invalid_request, description: Invalid client ID

    ==========

  • Karen Weir
    Karen Weir E Community Administrator

    I'm sorry for your experience. I will connect with colleagues to continue diagnosing this, and comment here for you.

  • dakdgdl
    dakdgdl Member
    edited January 16 #9

    As I understood, I don't have the "us.api……" section as you shown your screen shot.

    I have only these sections.

    capture.ot2.opentext.com

    capture.ot2.opentext.eu

    na-1-dev.api.opentext.com

    na-1.api.opentext.com

    How can I get the us section in my account?

    My usage is "Capture Services".

    Not the "Content Metadata Service".

  • Karen Weir
    Karen Weir E Community Administrator

    The documentation indicates that the US server is https://capture.ot2.opentext.com

    https://developer.opentext.com/services/products/capture-service/documentation/core-capture-overview#server-urls

  • Yes correct..

    But still I'm getting the error even when used that section.

    Please check with your collogues and let me know the reason..

    Thanks for your help and guidance..

  • LazarescuA
    LazarescuA E Community Moderator

    Hello @dakdgdl ,

    In order to use the Capture Service inside the Developer Trial, you need to do the following:

    1. Sign up for a trial and select the region (done, you already did that, selected the US region)
    2. In Admin Center, create a Tenant (if there is no Tenant created yet) (I assume you have one as it should be created by default)
    3. In Admin Center, at the Organization level, create a new Application (do not subscribe to the Core Capture trial, that is meant for using the Stand Alone SaaS app). Just click on the left menu: App Management > Apps and then click on the Add button and Add a new stand-alone app. This is what we call an IMS (Information Management Services) application. This will create the Public and Confidential client credentials that you will use to authenticate.
    4. The first application created in a Tenant will also create a Capture Application subscription that will respond to all queries to the Capture service. You do not need to obtain a token for the Capture subscription, any valid token for an IMS application will work with the Capture service.

    So, in order to test the Capture service, you need to obtain a token from your region (us.api.opentext.com), for your TenantId and for your IMS application ClientId and Secret.

    I see that in our Swagger Authorization, in the Capture service, we are missing the right authorization endpoint, so you won't be able to use that for testing until it is fixed. But there are two alternatives:

    • In the Capture Service overview (https://developer.opentext.com/services/products/capture-service ) there is a Postman collection that you can download and use the API's
    • You can use the Developer Workbench application (https://developer.opentext.com/cloud-platform/products/ocp/documentation/developer-workbench ) to test the API's in a user-friendly way and also see the calls used, export them, etc.

  • Thank you "LazarescuA"

    I'll try this way let you know..

  • Hi LazarescuA..

    I downloaded and installed "Developer Workbench application".

    Then saved the settings "TenantID", "ClientID", "Base URL as https://us.api.opentext.com", "Login mode as Popoup Window", OrganizationID" and "Application ID".

    Then clicked the login button.

    But it shows the popup window with this error.

    ===============

    {       
         "error":"invalid_request",        
         "error_description": "Invalid redirect URI "       
    }
    

    ================

    What could be the reason..Please advise..

  • Hi LazarescuA..

    I don't see a place to apply the redirect url in settings section of "Developer Workbench application".

    Currently it displays as "http://localhost:5000".

    Where I should set it to a my own local redirect url?

  • jpluimers
    jpluimers E Community Moderator

    @dakdgdl , see the User Guide for the Developer Workbench, via the questionmark icon in the right top. The first sections 'Basic settings and login' and 'OpenText Admin Console' explain how to use Admin Center to add the redirect url to the service client of the application you created.

  • Hi jpluimers.

    Thank you for responding.

    I set the redirect url at service client page as "http://localhost:5000".

    And tried again to login from http://localhost:5000".

    Then again the error came as this.

    {                  
      "error":"unauthorized tenant",                  
      "error_description": "authentication failed "      
    }
    

  • jpluimers
    jpluimers E Community Moderator
  • dakdgdl
    dakdgdl Member
    edited January 17 #19

    Hi jpluimers.

    I tried POSTing a request from postman, as this link/page says.

    But in the postman respond also gave the same error.

    Please check the screen shot.

    So its looks like, there is a matter in the tenant.

    Is it due to the free 90 days subscription?

    Please check the screen shot and let me know the reason.

    Thanks..

  • LazarescuA
    LazarescuA E Community Moderator

    Hi @dakdgdl ,

    I have removed the screenshot above as it contains secret information. To be on the safe side, you should regenerate the confidential client id and reset your tenant password.

    In order to debug your problem, let's start in the Admin center. Please login to the admin center and send screenshots of the:

    • Organization level with your app that you want to connect to (please make sure you are at the Org level, not Tenant level - see that in your breadcrumb)
    • The app service clients (by clicking the app tile above) - notice you are still at the Org level, not at the tenant level in the Breadcrumb. The redirect URL's should contain your URL (http://localhost:5000)
    • Lastly, click on the subscriber tenants tab and make sure your tenant is subscribed to the app

  • LazarescuA
    LazarescuA E Community Moderator

    Also, in the Developer Workbench, before logging in, in the Settings dialog, you can access the User Guide through this button:

    You have a chapter describing how to create and/or use an existing app:

  • dakdgdl
    dakdgdl Member
    edited January 18 #22

    Hi LazarescuA,

    Thank you for responding..

    Please check the screen shots attached, and let me know if any mistakes I have done.

    Now it is giving this error.

    {"fault":{"faultstring":"Invalid ApiKey","detail":{"errorcode":"oauth.v2.InvalidApiKey"}}}

  • Hi LazarescuA,

    Now I can login.

    2 things were, I haven't assign the app to tenant and I have used the organization level Service client's client id.

    Thank you for your help..

  • Hi LazarescuA,

    Now I got an error as below, when I tried to get the authenticated bearer token for APIs.

    ================

    {    "error": "unauthorized",    "error_description": "authentication failed "}

    ===============

    But I can login to the OCP Developer Workbench with the same TenantID.

    Please check the attached screen shot.

    I have followed these links.

    https://developer.opentext.com/services/products/capture-service/tutorials/classify-extract-correct-and-learn-images/2

    https://developer.opentext.com/services/products/capture-service/tutorials/capture-service-tutorial-guide/2

    Please let me know if any more changes to be done in the account.

    Also, when I tried to use the "Core Capture" online, I could login to that successfully.

    Then tried to Login to "Core Capture Designer". Then it also failed with this error.

    Please check the screen shot.

    Please let me know if any more required.

    Thanks..

  • LazarescuA
    LazarescuA E Community Moderator

    Hi @dakdgdl,

    The Get Access Token call is a POST call, not a GET call. You need to post the authentication data (clientId - this time it will be your CONFIDENTIAL client id, client secret, username and password):

  • Oh ok LazarescuA

    I'll try that way and let you know..

    Thanks for the response..

  • LazarescuA
    LazarescuA E Community Moderator

    For the Core Capture Designer, please see this section on how to configure your settings (specifically the URL and the site name):

    https://developer.opentext.com/services/products/capture-service/documentation/core-capture-overview

    So, for your case, the URL is going to be

    https://corecapture.us.opentext.com

    and the Site Name you should get from:

  • This time it said Invalid API Key.

    Please check the screen shot.

  • Hi LazarescuA..

    Now I could connect to the Core Capture Designer.

    Problem before was, I have used the URL with the "subscription-name" param.

    But still the token request failing with the error "Invalid ApiKey".

    Please let me know if any more to change?

  • LazarescuA
    LazarescuA E Community Moderator

    It might be that you are using a wrong Confidential Client Id and Secret. The one you should be using is the one in the APPLICATION (Org level, App management → Apps, click on your App and then Service clients). If you don't remember the Client Secret you will need to regenerate the client.

    Do not use the Org level Service client (that is only used to Add/Remove tenants, Add/Remove Apps, etc.).

    Do not use a tenant Service client.

  • dakdgdl
    dakdgdl Member
    edited January 23 #31

    Hi LazarescuA

    Yes actually.. I tried with the confidential-clientid and it's client-secret in this path.

    "Apoorva9808AppsApoorva9808 → Service clients".

    Please check the screen shot.

    Then again, I recreated the same confidential client and used the new id and secret too.

    Still the same error "Invalid ApiKey" is coming as the result.

    I'm using the tenant-username and tenant-password with the "grant_type": "password".

    What could be the reason? Any thing wrong in the account?

    Do I have to pass any header parameter too, like an initial API-Key given by you or account itself?

    Currently I'm not passing any header parameter. Only thing I pass is the JSON structure as below, via "body → raw" section.

    {"client_id": "my-confidential-client-id", "client_secret": "my-confidential-client-secret", "grant_type": "password", "username": "dakdgdl@yahoo.com", "password": "my-tenant-password" }

    Please check and let me know.