Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7664561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:20:17+00:00 2026-05-31T14:20:17+00:00

I am creating an application for a client that integrates with the LinkedIn API.

  • 0

I am creating an application for a client that integrates with the LinkedIn API. I got through the authentication without too many problems, but everything there is working and now I need to make the actual requests. Primarily I am working in the Share API. I create the HTTP call with the following method:

  public any function sendRequest(any req){
    var param = false;
    var headParams = [];
    var bodyParams = [];
    var call = new http(proxyserver='192.168.201.12', proxyport=8888);
    var i = 1;

    call.setUrl(Arguments.req.getRequestUrl());
    call.setMethod(Arguments.req.getMethod());

    getSigner().signRequest(Arguments.req);

    headParams = Arguments.req.getParameters(true);
    bodyParams = Arguments.req.getParameters();

    if(arrayLen(bodyParams)){
      call.addParam(
        type='header',
        name='Authorization',
        value="OAuth#Variables.encoder.encodedParameter(Arguments.req.getParameters(true), true, false, true)#"
      );
    }

    // Header parameters
    if(!arrayLen(bodyParams)){
      for(i=1; i<=arrayLen(headParams); i++){
        param = headParams[i];
        call.addParam(
          type=Arguments.req.getParameterType(),
          name=Variables.encoder.parameterEncodedFormat(param.name),
          value=param.value
        );
      }
    }

    // Body parameters (should only be 1)
    if(arrayLen(bodyParams)){
      for(i=1; i<=arrayLen(bodyParams); i++){
        param = bodyParams[i];
        call.addParam(
          type='xml',
          value=param.value
        );
      }
    }
    return call.send().getPrefix();
  }

When I sign the request, I use the following method:

  public void function signRequest(any req){
    var headParams = Arguments.req.getParameters(true);
    var bodyParams = Arguments.req.getParameters();
    var secret = "#Variables.encoder.parameterEncodedFormat(getConsumer().getConsumerSecret())#&#Variables.encoder.parameterEncodedFormat(Arguments.req.getOAuthSecret())#";
    var base = '';

    params = Variables.encoder.encodedParameter(headParams, true, true);
    params = "#params#&#Variables.encoder.parameterEncodedFormat(bodyParams[1].value)#";

    secret = toBinary(toBase64(secret));

    local.mac = createObject('java', 'javax.crypto.Mac').getInstance('HmacSHA1');
    local.key = createObject('java', 'javax.crypto.spec.SecretKeySpec').init(secret, local.mac.getAlgorithm());

    base = "#Arguments.req.getMethod()#&";
    base = base & Variables.encoder.parameterEncodedFormat(Arguments.req.getRequestUrl());
    base = "#base#&#Variables.encoder.parameterEncodedFormat(params)#";
    //writeDump(base) abort;
    local.mac.init(local.key);
    local.mac.update(JavaCast('string', base).getBytes());

    Arguments.req.addParameter('oauth_signature', toString(toBase64(mac.doFinal())), true);
  }

I have tried signing it with only the header parameters (usual OAuth params) and include the body parameter (xml string), but everything gives me a 401 error, so I was wondering what I should be using in my base string that gets signed for the request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:20:19+00:00Added an answer on May 31, 2026 at 2:20 pm

    Not a proper answer to your question, but may help you.

    In my case after many unsuccessful tries of using the LinkedIn API with CF8, I finally gave up / didn’t have more time for it. Instead of a “proper” integration I’ve used the linkedin-j Java library. It finally got me going and I didn’t encounter any more signing issues.

    Btw for all my integrations requiring OAuth I’ve used this library and didn’t have any signing issues as with LinkedIn API.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a desktop/client application that will be installed on +/- 5 PCs,
I am creating a 3 tier application. Basically it goes Client -> (through optional
I am creating a web application for a client that has the ability to
I'm creating a client application that connects to MS SQL Sever via ADO.NET. I
I am creating an intranet application in php that is running on a client's
I am creating a simple HTTP client/server application on my local machine but I
You may skip this part: I am creating an application where the client needs
I'm creating an installer for my Windows client application. Currently I create an MSI
I am thinking of creating a multi-platform portable C++ server-client application. Is it even
I am creating an application to be accessed by multiple clients, but each customer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.