Developer Workbench authentication

System
System Administrator Member
edited October 29, 2024 in Thrust Studio #1
This discussion was created from comments split from: OCP Developer Workbench - API testing app.

Comments

  • LazarescuA
    LazarescuA E Community Moderator

    Hi @John Kendall ,

    Looks like you have set things correctly on the App Client.

    Can you please also check the Tenant Id and see if you have entered the correct client id in the workbench settings? It is supposed to be the same one as the one in the Admin Center (the Public one):

    The application also needs to be subscribed to the tenant:

  • I finally did get this to work today. I was accidentally using the private client ID. Thanks for the help LazarescuA!

    However, the VSCode extension (OpenText Thrust Studio Foundation) is still giving this same (invalid) error. And I've been using the public ID from the start there. Why does it not require the TenantID to be entered like the workbench? (I did try using the tenant ID but that didn't work either. I also tried creating a new profile but same error)

    BTW, maybe improve the error message as it is clearly not correct to say the redirect URI is missing/wrong.

  • FWIW, the cli also fails:

    johnk@Bamboo2 opentext_poc % ocp local profile authenticate
    Using public credentials for authentication.
    Pre-Authorization has failed.
    Rest Error with Subtype = AUTHENTICATION_REST_ERROR
    Rest Response HTTP Status: [400], Status Text: "Bad Request"
    Reason: "Pre-Authorization has failed."
    Authentication Error: INVALID_REDIRECTION_URI
    Authentication Error Description: Invalid redirect URI. Please check the configured redirect URI at the DEVX console matches your profile
    johnk@Bamboo2 opentext_poc %

    Also, there is nothing listening on port 5013 (unless I have the OCP workbench running)

    Thanks,
    John

  • jpluimers
    jpluimers E Community Moderator

    @John Kendall wrt to authentication in VS Code. This uses the organization Public service client. With that we can deploy to any tenant instead of the developer needing to manage all tenant service clients in VS Code.
    When giving the user credentials, be sure to use the organization level credentials.
    Also note that this service client already has a predefined Redirect url http://localhost:22682/login/oauth2/code. This url is used by VS Code (and ocp cli).
    As you get the error about INVALID_REDIRECTION_URI when using the ocp cli I expect that you did not configure organization Public service client in the org profile.

    For detailed help on creating an organization profile in VS Code see chapter 3.1 of the OpenText Cloud Developer Tutorial.

    A note on the ocp cli. Both VS Code and the ocp cli share the same authentication code, So when one fails the other also would fail.

  • That was my error; I was using the public "service client" for the App not the Organization. I see that the tutorial does actually say that but I must have glossed over it. Sorry for that! Maybe the word organization should be emphasized since there are so many levels of service clients.

    So both the cli and VSCode are now connected.

    Thanks,

    John

  • jpluimers
    jpluimers E Community Moderator

    Thanks for the update @John Kendall So you're good now?

  • Yes. I've been building a workflow in VSCode and have validated the cli works as well.

    Thanks,
    John

This discussion has been closed.