Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to assign Connected App to any desired profile programatically by using apex or metadataapi in Salesforce?

    Tagged: Apex, Components, Salesforce APIs, Salesforce Apps, Salesforce Connected Apps, Salesforce Metadata, Salesforce.com, Web Services

    • Salesforce® Discussions

      How to assign Connected App to any desired profile programatically by using apex or metadataapi in Salesforce?

      Posted by Prachi on December 9, 2019 at 6:21 PM

      How to assign Connected App to any desired profile programatically either by using apex or metadataapi?

      Deepak replied 6 years, 1 month ago 2 Members · 1 Reply
      • Apex
      • Components
      • Salesforce APIs
      • Salesforce Apps
      • Salesforce Connected Apps
      • Salesforce Metadata
      • Salesforce.com
      • Web Services
    • 1 Reply
    • Deepak

      Member
      December 10, 2019 at 2:00 PM

      You can use the Salesforce Metadata API(http://www.salesforce.com/us/developer/docs/api_meta/) to create a Connected App(https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_connectedapp.htm), it provides the ConnectedApp metadata type for this purpose. You can either use the File Based method(https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_file_based_calls_intro.htm) or the CRUD method(https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_crud_based_calls_intro.htm) (preferable for programmatic 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 connected apps 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 you're using a Java, there is a prebuilt client library available here(https://developer.salesforce.com/page/Introduction_to_the_Force.com_Web_Services_Connector). There is also an Apex wrapper(https://github.com/financialforcedev/apex-mdapi) around the API if you're interested in doing this natively.

      Hope this helps.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Apex Triggers

    Apex Triggers in Salesforce | Here's the Ultimate Salesforce Guide

    Blog in Salesforce Apex

    Apex Trigger  Trigger is a concept of automating processes and solving complex scenarios. These are stored procedures which execute whenever any particular event occurs. We…

    Apex Trigger, Application Interface, Automating Process, Before Trigger, Bulk Trigger
    bhawana Sep 6, 2022
    3,363  Views

    How Salesforce AppExchange Makes Business Solutions Easier

    Blog in Others

    In today’s fast-paced business environment, organizations need flexible, scalable solutions to meet evolving demands. Salesforce AppExchange has become a vital platform for businesses seeking ready-to-use…

    Anna Nov 11, 2025
    462  Views

    Salesforce Sales Cloud - The Complete Guide

    Blog in Sales, Salesforce Cloud Platform

    Introduction As we already know Salesforce CRM helps every industry to win more deals, manage the business efficiently and to build strong relationships with customers.…

    Benefits of Salesforce, Guide, Lightning, Sales Cloud, salescloud
    Emorphis Aug 8, 2022
    5,507  Views

    Popular Salesforce Videos

    Password Protect Records in Salesforce

    Password Protect Records in Salesforce

    Video in Salesforce Security

    Suppose Salesforce org record level access is set to Public Read Only and now business want to restrict few records visible to only those users…

    Salesforce Training, Salesforce Security, salesforce, Salesforce Org, Salesforce Developers
    Vinay May 1, 2020
    2,485  Views
    Wow Your Customers with Salesforce Customer 360 Salesforce

    Wow Your Customers with Salesforce Customer 360 Salesforce

    Video in Salesforce Products

    Wow Your Customers with Salesforce Customer 360 Salesforce. Watch this video to learn all about it. Do let us know in the comments if you…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Video, Salesforce Account
    Rupal Kakkar Mar 28, 2022
    2,992  Views
    Understanding Pardot: The Ultimate Guide for Salesforce Admins

    Understanding Pardot: The Ultimate Guide for Salesforce Admins

    Video in Salesforce Products

    In this podcast, Andrea Terrell shares advice for Salesforce Admins on how they can level up their Pardot skills. She has a proven track record…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Admins, Salesforce Video
    Rupal Kakkar Nov 2, 2021
    1,819  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.