You need to sign in to do that
Don't have an account?
Ken Koellner 8
outbound oauth example
When searching the documentation for information on oauth, I find lots of information on other applications calling into salesforce to get access to SF. Unfortunately, that's not the task I need to perform. I need to, from salesforce, get access to another application.
I'm wondering if anyone knows of any good examples or tutorials for outbound authorization to other applications.
I think there may be ways to get help doing it with Per User Named Credentials but I would really like to see some examples of how to configure and code it.
I'm wondering if anyone knows of any good examples or tutorials for outbound authorization to other applications.
I think there may be ways to get help doing it with Per User Named Credentials but I would really like to see some examples of how to configure and code it.
Outbound authorization to third party applications depends on their API, which authentication method they are providing, Basic or Oauth Flow.
Every application provider give us API doc which explain their flow of supported authentication.
I have just created a sample VF page and Apex class which demonstrate you outbond API authentication with Twitter and reterive latest tweets from official twitter handler of @Salesforce.
You need to create a sample APP on twitter (https://apps.twitter.com) , then replace the consumer key and consumer secret in my class variable with your own app's value.
Doc reference for Twitter API which I have used in above code:
Create Twitter APP: https://developer.twitter.com/en/docs/basics/authentication/guides/access-tokens
Generate OAuth 2 Bearer Token: https://developer.twitter.com/en/docs/basics/authentication/api-reference/token
Get Tweet timelines: https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-mentions_timeline.html