Problem with cloud based TM and the credentials

Hello,

I am creating a FileBasedProject based on a template. The template references a cloud-based TM. When I try to run the task sequence via the Studio API, I get the following error:

Fullscreen
1
Unexpected exception when initializing task 'Analyze Files': Authentication failed for translation provider 'languagecloud.translation.https://671a3cbd5ba2d5774df8cd41/?SmartLookupEnabled=False&ProfileName=General%2b-%2bTranslation%2bEngine'..
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I added the following code. Unfortunately, I cannot get the authentication to work. I copied the URI directly from the template file. We log in via SSO.

Fullscreen
1
2
// Add credentials
newProject.Credentials.AddCredential(new Uri(“languagecloud.translation.https://671a3cbd5ba2d5774df8cd41/?SmartLookupEnabled=False&ProfileName=General%2b-%2bTranslation%2bEngine”), true, “user”, “password”);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is this the right way to do it? Does a domain have to be specified for the user? If so, in what form? “domain\user” has not worked so far.

Thank for your help.



-
[edited by: André at 1:45 PM (GMT 1) on 9 May 2025]
  • Hi , please make reference to this forum post that provides information on how access a language cloud resource from Trados Studio automation:  RE: Programmatically Pre-translate a Project with Language Weaver as a MT resource 

    Example automation project: github.com/.../StandAloneConsoleApp_PretranslateUsingProvider

  • Hi Patrick,

    thanks for the reference to the other post.

    I tried it, but I still get "Authentication failed".

    The example in the other post is kind of strange. I added the credentials (API Key) and later in the code a authentication via Client ID is done. I would expect, that API Key should be enough. Authentication via Client ID is working. The token will be returned.

    This is basically the code. Maybe I overlooked something.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    public void Create()
    {
    // Load Template
    ProjectTemplateReference template = new ProjectTemplateReference(_templateFile);
    // New template based project
    FileBasedProject newProject = new FileBasedProject(this.GetInfoForTemplateProject(), template);
    Console.Clear();
    // Add credentials
    // Update this variable with the actual URI of the translation provider.
    // You can retrieve this value from an existing project or project template (.sdlproj/.sdltpl).
    // To do this, open the project file in a text editor of your choice.
    // Look for the XML element <CascadeEntryProvider> and its child elements.
    // These elements should contain the URI for the translation provider.
    //
    // For example:
    // - URIs starting with "languagecloud.translation.https://" indicate a Translation Engine.
    //
    // Copy the complete URI from the project/template file and assign it to the variable below.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX