Awesome
OAuth Sample App
<a href="https://githubsfdeploy.herokuapp.com?owner=financialforcedev&repo=ffhttp-core-samples"> <img alt="Deploy to Salesforce" src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png"> </a>Summary
This app has been built to demonstrate the use of the Core library. Specifically, it demonstrates how the library can be used to develop a VisualForce UI for the OAuth client.
Configuration
This section explains how to configure the OAuth Sample App.
- Deploy the Core package to your Salesforce organisation.
- Deploy the OAuth Sample App to your organisation.
- If the OAuth Sample App shows in the app menu then go to step 9.
- Otherwise, go to Setup > Manage Users > Users.
- Select your user.
- Select Edit Assignments in the Permission Set Assignments section.
- Add the OAuth Sample App Permissions permission set and Save.
- The OAuth Sample App project should display in the app menu.
- Select the OAuth Sample App project. The Connector Types and Connectors tabs should be displayed.
Creating a connection to another service
Once the app has been deployed you can then connect to another service. This section explains how to create a connection to Dropbox.
###Create an app in Dropbox
- Create (or log in to) your Dropbox account.
- Go to https://www.dropbox.com/developers/apps and select Create App.
- Select Dropbox API app for What type of data does your app need to store on Dropbox?.
- Select Files and datastores for Can your app be limited to its own folder?.
- Select No as Can your app be limited to its own folder?.
- Select All file types for What type of files does your app need access to?.
- Enter an App name and select Create App.
- Set the Redirect URIs to the URL of the Salesforce organisation e.g. https://eu3.salesforce.com/apex/connector.
- Make sure you know the App Key and App Secret as they will be needed later.
###Create a Connector in Salesforce
- Log in to your Salesforce organisation.
- Select the OAuth app.
- Select Connector Types then New.
- Enter a Connector Type Name e.g. Dropbox.
- Set the Authorization Endpoint to https://www.dropbox.com/1/oauth2/authorize.
- Set the Token Endpoint to https://api.dropbox.com/1/oauth2/token.
- Set the Client ID to the App Key obtained earlier.
- Set the Client Secret to the App Secret obtained earlier.
- Set the Redirect URI to the same URL as you set in step 8 in the Create an app in Dropbox section.
- Set the Developer Name e.g. Dropbox
- If Developer Name is not seen, go back to setup step 4 in the configuration section above.
- Make sure that Scope Required is unchecked.
- Set the scope to https://api.dropbox.com/.
- Save the Connector Type.
- Select New Connector.
- Set the Connector Name and save.
- Select the Connector and then Activate. You will be directed to another Salesforce page that activates your connector.
- Select Authorize. This will prompt you to log in to your Google account (if you are not already logged in) and then authenticate the scope provided earlier. Select Accept to authorize.
- Select Save. The connector is now ready for use.
Reporting Issues & Enhancements
Please report any issues using the github issues feature. Suggestions / bug reports are welcome as are extensions containing additional functionality.