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?



Best Answer

  • kamuela
    kamuela Domo Employee
    Answer ✓

    Hua, if you login to the Connector Dev studio ( 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.






    I am no longer with Domo. Please @mention @Millhouse for connector specific questions.


  • Hi all,

    Can anybody help out @Hua?


  • Maxamillioo
    Maxamillioo Domo Employee

    Hi @Hua,

    Thank you for reaching out! Currently the best resource for finding information about building custom connectors can be found at 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.

    Thank you!


    Dojo User
    **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"
  • Hello,


    I do not see the Facebook custom connecter in my builder portal. Was it removed?

  • evanbench
    evanbench Domo Employee

    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.

  • Yup, looks like the facebook example has been removed. :(  Anyone still have that sample code?

  • I still see Facebook sample there on my view:!/edit/4812a950-c949-4bb4-8231-f044651d4c60


    Can you see it?  If not, it needs to be raised to DOMO connector support.  Good luck!

  • 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 domain to register for the "Site URL" of the Facebook app is "". After you create a new app, go to the Basic settings and configure "" 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 Additional Authorization Parameters (Optional) can be left blank.
    5. Access Token URL should be 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:
    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 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:
    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('');


  • @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?

This discussion has been closed.