How to autheticate Twitter endpoint from ADF

Viewed 141

To authenticate the Twitter endpoint I have below information from Twitter developer portal

  • client key

  • client secret

  • access token

  • access token secret

I am trying to hit an endpoint using web activity, but not sure how to pass above credentials to make the endpoint authentication successful. I tried all the credentials in the URL itself and also passing into the header, but none of them worked. I had successful response in POSTMAN.

Kindly help me on this.

Thanks

1 Answers

As a first step you'd need a create signature base string by the OAuth specification.

https://developer.twitter.com/en/docs/authentication/oauth-1-0a/creating-a-signature

You'd need to create signature

Pass the signature along the headers.

authorization: OAuth 
oauth_consumer_key="CONSUMER_API_KEY"
oauth_nonce="OAUTH_NONCE"
oauth_signature="OAUTH_SIGNATURE"
oauth_signature_method="HMAC-SHA1"
oauth_timestamp="OAUTH_TIMESTAMP"
oauth_token="ACCESS_TOKEN"
oauth_version="1.0"'

Within ADF, you'll not be able to generate the signature you have a powershell script and batch service / Azure function to generate the Signature.

Note : The signature will be unique for every request.

Alternatively, you could make use Oauth2.0 Issue request using the Bearer Token:

https://developer.twitter.com/en/docs/authentication/oauth-2-0

Note : There is a Beta version which allows user context using Oauth2.0

This will not require any encryption or additional mechanism.

Related