Is there any sample code with custom connector, using OAuth2 authentication?
I found some limitation of existing Rally connector, and trying to explore if a custom connector can be built to help me through. But I'm behind SSO and not familiar with that layer, so need some help to get over the authentication step first. Is there anyone in the community who can give me some sample code?
kamuela Domo Employee
Hua, if you login to the Connector Dev studio (https://developer.domo.com/builder) using your Domo credentials, we have recently added a sample Facebook connector that uses OAuth for authentication. We will also be adding it to the documenation on the developer portal in the next week or so.
SamI am no longer with Domo. Please @mention @Millhouse for connector specific questions.3
Thank you for reaching out! Currently the best resource for finding information about building custom connectors can be found at developer.domo.com. There you can search through various documentation that may be helpful in what you are trying to accomplish.
In the mean time, I will also be forwarding your question to a team here that may be able to provide you with additional information.
**Say "Thanks" by clicking the "heart" in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
I do not see the Facebook custom connecter in my builder portal. Was it removed?1
Looking for sample OAUTH 2.0 script that works. The default Facebook connector is very limited and does not show how to handle requests for authorization code in the logic of the authorization process.0
Yup, looks like the facebook example has been removed. Anyone still have that sample code?0
I still see Facebook sample there on my view:
Can you see it? If not, it needs to be raised to DOMO connector support. Good luck!0
Not sure about anyone else but I do not have the custom facebook connector app in my list in builder. Domo support was nice enough to send me the sample auth code. See below.
If you do not already have a Facebook App then you will need to create one to use this example connector. You can do this by registering a new app at https://developers.facebook.com/quickstarts/.The domain to register for the "Site URL" of the Facebook app is "developer.domo.com". After you create a new app, go to the Basic settings and configure "developer.domo.com" as an "App Domain".
Next, you need to enter the Client Key and Client Secret here. The "Client Key" should be your Facebook "App ID" and the "Client Secret" should be your Facebook "App Secret". You can find both of these in the Settings of the new app that you create.
Your fields should be configured as follows:
1. Client Key should be the App ID from your new Facebook app.
2. Client Secret should be the App Secret from your new Facebook app.
3. Authorization URL should be https://www.facebook.com/dialog/oauth4. Additional Authorization Parameters (Optional) can be left blank.
5. Access Token URL should be https://graph.facebook.com/oauth/access_token6. Access Token Request Method should be POST
7. Additional Access Token Parameters (Optional) can be left blank.
8. Scope should be set to "email" (read more about permissions here: https://developers.facebook.com/docs/facebook-login/permissions#reference-email)
Once you have filed out the OAuth2.0 form to the right, click "Get Access Token", log in to Facebook, and check the DOMO.log output to see if OAuth2.0 authentication was successful.
For other questions, please see https://developers.facebook.com/docs/facebook-login for more information*/
//All code below this point will only execute when "Run Script" is clicked. You must have successfully received an Access Token from Facebook first by clicking "Get Access Token"
//These two lines print the Facebook Auth Code and Facebook Access Token, respectively, for reference.DOMO.log('metadata.account.code: ' + metadata.account.code);
DOMO.log('metadata.account.accesstoken: ' + metadata.account.accesstoken);
//Add the access token from Facebook to the HTTP Headers. Some examples are given here: https://developers.facebook.com/docs/workplace/account-management/api
httprequest.addHeader('Authorization', 'Bearer ' + metadata.account.accesstoken);
//Make a request using the Access Token to get the user name and ID of the user who successfully authenticated with OAuth2.0.//Since scope was set to "email" we should also get the email address in the users profile, if there is one.var res = httprequest.get('https://graph.facebook.com/v2.5/me');0
@Millhouse Please see above.
I accidently saved over my facebook example connector; is there a way to get it reset? Maybe post it to the developer section examples like the rest?0
- 7.7K All Categories
- 5 Connect
- 921 Connectors
- 244 Workbench
- 479 Transform
- 1.8K Magic ETL
- 60 SQL DataFlows
- 446 Datasets
- 49 Visualize
- 202 Beast Mode
- 2K Charting
- 8 Variables
- 21 Cards, Dashboards, Stories
- 1 Automate
- 348 APIs & Domo Developer
- 82 Apps
- 14 Predict
- 3 Jupyter Workspaces
- 11 R & Python Tiles
- 241 Distribute
- 59 Domo Everywhere
- 241 Scheduled Reports
- 15 Manage
- 36 Governance & Security
- 37 Product Ideas
- 1.1K Ideas Exchange
- 2 Community Forums
- 15 Getting Started
- 2 Community Member Introductions
- 50 Community News
- 18 Event Recordings
- 579 日本支部