Close Menu
MyKnowTech
    MyKnowTech
    • Technical Blogs
    • Career
    • Partner Spotlight
    • Videos
    • Pega News
    • Services
    LinkedIn YouTube Facebook
    MyKnowTech
    Videos

    Understanding CORS Policy in Pega

    Editorial TeamBy Editorial TeamMay 25, 2026Updated:May 26, 2026No Comments4 Mins Read
    Share LinkedIn Telegram Email WhatsApp Copy Link

    CORS is one of those security concepts that causes a lot of confusion until you see it break something.

    Cross-Origin Resource Sharing is a browser-level security mechanism that controls which external domains are allowed to access your APIs. If you are exposing Pega REST services to a web application hosted on a different domain, CORS is going to matter to you.

    The Core Concept

    When a browser-based application on domain A tries to call an API on domain B, the browser checks first whether domain B has given permission. If it has not, the browser blocks the request – even if the network allows it. This is CORS.

    In Pega terms, if you have a React application or any front-end app calling Pega DX APIs, and that app is hosted on a different URL from your Pega server, CORS configuration determines whether those calls succeed or fail.

    Note – this is browser-specific. Back-end Java applications calling your APIs are not affected by CORS. It only applies when a browser is involved.

    How CORS Is Configured in Pega

    In Dev Studio, go to Records – Security – Cross-Origin Resource Sharing. Pega ships three out-of-the-box instances – Default, Allow All Origins and API Headers Allowed.

    The key configuration blocks are allowed origins, allowed methods, allowed headers, exposed headers, allow credentials and maximum age.

    Allowed origins is the most important one. Using a wildcard allows any domain to access the API. Specifying explicit domains restricts access to only those origins. If a request comes from a domain not in the list, the browser blocks it with a 403 error and you will see a CORS error in the console.

    Allowed methods controls which HTTP methods are permitted – GET, POST, PUT, DELETE, PATCH. You can restrict to specific methods if needed.

    Allowed headers specifies which request headers the browser is permitted to send – typically includes Authorization and Content-Type.

    Exposed headers defines which response headers JavaScript code in the consuming application can access. Browsers restrict header access by default even with CORS enabled, so headers you want to read from JavaScript need to be explicitly exposed.

    Maximum age sets how long the browser caches the pre-flight result in seconds.

    What Pre-Flight Requests Are

    When a browser makes a cross-origin API call, it first sends an OPTIONS request to check whether the call is permitted. This is the pre-flight request.

    The pre-flight checks the origin, the method and the headers against your CORS configuration. If everything is allowed, the actual API call proceeds. If anything is blocked, the browser stops there and returns a CORS error.

    Pre-flight results are cached based on the maximum age setting, which is why you only see pre-flight requests on the first call to each endpoint, not on every subsequent call.

    Mapping CORS Policy to Endpoints

    Defining a CORS rule is only half the work. You also need to map it to your endpoints.

    Go to Configure – Integration – Services – Endpoint CORS Policy Mapping.

    Here you specify which resource paths get which CORS policy. The out-of-the-box setup maps all API endpoints to the API Headers Allowed policy. If you want a more restrictive policy on specific endpoints, you create a new CORS rule and map it to just those paths.

    Watch the Full Walkthrough

    In the video below I demonstrate live how CORS works – removing an allowed origin, watching the 403 error appear in the browser console, then restoring it and seeing the calls succeed. Includes a full explanation of pre-flight requests and the header blocks.

    CORS is one of those topics where seeing it break and then fix is worth more than any amount of reading. This video gives you that.

    Advanced
    Editorial Team

    An insightful team dedicated to empowering the Pega ecosystem with in-depth knowledge, guided by Premkumar Ganesan's vision.

    Related Posts

    Videos

    Application URL Alias in Pega

    May 25, 2026
    Videos

    Understanding Components in Pega

    May 25, 2026
    Videos

    Content Security Policy in Pega

    May 25, 2026
    Videos

    Five Best Practices for Creating Connectors in Pega

    May 25, 2026
    Videos

    How to Plan a Pega Upgrade – A Practical Guide

    May 25, 2026
    Videos

    How to Analyse a Heap Dump in Pega

    May 25, 2026
    Videos

    How to Store Case Attachments in External File Storage in Pega

    May 25, 2026
    Videos

    Data Encryption in Pega Using HashiCorp Vault

    May 25, 2026
    Videos

    Understanding Stack Memory in Pega

    May 25, 2026
    Videos

    Packaging Your Pega Application for the First Time

    May 25, 2026
    Search through the blog
    Tags
    activity Advanced authentication background-processing Beginner case-management Constellation data-model declarative-processing email-processing file-processing Integration pega-core-concepts pega-integration process reporting security system-administration user-interface validation
    Pega Courses

    Pega courses can be accessed at https://myknowacademy.com

    About

    MyKnowTech is a boutique Pega enablement and consulting firm – helping organizations build internal Pega capability through structured training programs, Centre of Excellence setup and hands-on architecture guidance.

    Company
    • About
    • Leadership
    • Career
    • Contact
    Resources
    • Technical Blogs
    • Career
    • Partner Spotlight
    • Videos
    • Pega News
    • Services

    ©  MyKnowTech B.V. All Rights Reserved.

    • Sitemap
    • Terms & Conditions
    • Privacy Policy