Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is there a way to define connected apps w/o opening the UI? Has anyone already created apps like that? Any advice would be appreciated!!

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You can use the Salesforce Metadata API to create a Connected App, it provides the ConnectedApp metadata type for this purpose. You can either use the File Based method or the CRUD method (preferable for programatic creation).

Represents a Connected App application. A connected app is an application that integrates with salesforce.com using APIs. Connected apps use standard SAML and OAuth protocols to authenticate, provide Single Sign-On, and provide tokens for use with Salesforce APIs. In addition to standard OAuth capabilities, connected apps allow administrators to set various security policies and have explicit control over who may use the applications. It extends the Metadata metadata type and inherits its fullName field.

ConnectedApp components have the suffix .connectedapp and are stored in the connectedapps folder.

This API is available in any language supporting HTTP callouts using Web Services (Salesforce provides a WSDL to consume in your client app). If your using a Java, there is a prebuilt client library available here. There is also an Apex wrapper around the API if your interested in doing this natively.

share|improve this answer
    
Thank you so much Andrew. Is there any sample code that tells how I can use Metadata Types?? The code sample in that page uses soap Api. So I'm wondering if I can follow the same procedure. Thanks again! –  user7053 Mar 3 at 17:44
    
Sure, what language are you using and i can advise accordingly. –  Andrew Fawcett Mar 3 at 21:02
    
Thank you. Right now I'm using Groovy / Java. My short term goal is to create a connected app (as automated as possible) in each and every new pod once it is added. –  user7053 Mar 3 at 21:50
2  
I'm able to create apps now with code. There was a small mistake in my code so I kept getting errors the whole day. Now its working. Thank you once again. –  user7053 Mar 3 at 22:59
    
Awesome so please you got it working, i love the Metadata API! :-) –  Andrew Fawcett Mar 4 at 10:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.