• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Developer Community SDK Questions
C

Claudio

started a topic about 4 years ago

SDK Connector - Connection failed: Not implemented

Hi,

I'm writing an SDK connector for my application. I get the error "Connection failed: Not implemented" when I try to test the authorization part (custom_auth). Workato doesn't send the request so the problem should be in the code. I haven't found anything online so far about this. Below my connector authentication code:

 

{
    title: 'Test SDK',

    connection: {
        fields: [
            {
                name: 'host',
                label: 'Hostname',
                optional: false
            },
            {
                name: "client_id",
                label: 'Client ID',
                control_type: "password",
                optional: false
            },
            {
                name: "client_secret",
                label: 'Client SECRET',
                control_type: "password",
                optional: false
            },
            {
                name: "client_scope",
                label: 'Client SCOPE',
                optional: false
            }
        ],

        authorization: {
            type: 'custom_auth',

            acquire: lambda do |connection|
                {
                    auth_token: post("https://#{connection['host']}/oauth/token").
                        payload(
                            grant_type: "client_credentials",
                            client_id: connection['client_id'],
                            client_secret: connection['client_secret'],
                            scope: connection['client_scope']
                        ).
                        headers(
                            'Accept' => "application/json",
                            'Content-Type' => "application/x-www-form-urlencoded",
                        ).dig('access_token')
                }
            end,

            refresh_on: [401],

            test: lambda do
                get("/api/check/machine")
            end,

            apply: lambda do |connection|
                headers(
                    'Accept' => "application/json",
                    'Content-Type' => "application/x-www-form-urlencoded",
                    'Authorization' => "Bearer #{connection['auth_token']}"
                )
            end
        },

        base_uri: lambda do |connection|
            "https://#{connection['host']}"
        end
    }
}

 


1 person has this question
K

Kevin Yu

said over 3 years ago

Hi,


I noticed that your test block is within the authorization block.

You are getting the error because Workato cannot find the test block.

Put the test block all the way out, living along with the title and connection blocks.

Refer to https://docs.workato.com/developing-connectors/sdk/walk-through.html


Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count