1

I got a problem with the xing oauth api.

Currently this works:

  1. Get a request token from xing
  2. Redirect the client to authentificate at xing
  3. Get the callback from xing

Now I have to get the access token from xing, using the oauth token and verifier.

I'm using the same code to generate the oauth signature for this like when I request the request token at step 1.

With this function, I generate the signature:

private function buildOauthSignature($httpMethod, $requestTokenUrl, $params) {
    // Remove 'oauth_signature' if it's empty
    if (empty($params['oauth_signature'])) {
        unset($params['oauth_signature']);
    }

    $parts = array(
        $httpMethod,
        $requestTokenUrl,
        $this->buildQuery($params)
    );

    $parts = $this->urlencode_rfc3986($parts);

    $signatureBaseString = implode('&', $parts);

    $keyParts = array(
        $this->strategy['consumer_secret'],
        ""
    );
    $key = implode('&', $keyParts);

    return base64_encode(hash_hmac('sha1', $signatureBaseString, $key, true));
}

Does someone know this?

Marcel
  • 627
  • 7
  • 25

0 Answers0