# Configure publisher

**URL:** <https://discuss.openedx.org/t/configure-publisher/7439>\
**Category:** Site Operations Help\
**Tags:** how-to\
**Created:** [June 9, 2022, 2:55pm UTC](https://discuss.openedx.org/t/configure-publisher/7439 "2022-06-09T14:55:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 9, 2022, 2:55pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/1 "2022-06-09T14:55:24Z")

</div>

I want to install publisher but not installing i am getting cors error always please guide me how to resolve this cors error

Unable to load data: Axios Error (Request): Network Error (possible local connectivity issue) get [https://discovery.xxxx.in/api/v1/courses/](https://discovery.xxxx.in/api/v1/courses/).

Access to XMLHttpRequest at ‘[https://discovery.xxxx.in/publisher/api/admins/organizations/users/?page=1&page\_size=250](https://discovery.xxxx.in/publisher/api/admins/organizations/users/?page=1&page_size=250)’ from origin ‘[https://apps.xxxx.in](https://apps.xxxx.in)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Access to XMLHttpRequest at ‘[https://discovery.xxxx.in/api/v1/organizations/?page=1&page\_size=500&limit=500](https://discovery.xxxx.in/api/v1/organizations/?page=1&page_size=500&limit=500)’ from origin ‘[https://apps.xxxx.in](https://apps.xxxx.in)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Failed to load resource: net::ERR\_FAILED

[https://discovery.xxxx.in/publisher/api/admins/organizations/users/?page=1&page\_size=250](https://discovery.xxxx.in/publisher/api/admins/organizations/users/?page=1&page_size=250)

Please guide me how to do resolve it i am using this repo

> **[GitHub - Dicey-Tech/tutor-contrib-publisher: This is an experimental Tutor...](https://github.com/Dicey-Tech/tutor-contrib-publisher)**
>
> This is an experimental Tutor plugin. You should not consider it ready for production use at this point. - GitHub - Dicey-Tech/tutor-contrib-publisher: This is an experimental Tutor plugin. You sho...

---

<div class="post-metadata">

**Author:** ![nedbat](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/nedbat/32/3317_2.png) [@nedbat](https://discuss.openedx.org/u/nedbat)\
**Post date:** [June 9, 2022, 6:10pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/2 "2022-06-09T18:10:25Z")

</div>

Hi. I understand you want help with your problem, but please don’t ping random people to help. The people who are available will be reading the topics to see where they can help.

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 9, 2022, 6:33pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/3 "2022-06-09T18:33:47Z")

</div>

so Sorry @nedbat but since you are the oldest member and knowledgeable people thats why i pinged you only guys

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 11, 2022, 7:57pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/4 "2022-06-11T19:57:35Z")

</div>

@BbrSofiane Please guide me i am working on this problem from last 4 days. I am tagging my thread from overhang here please help me with problem

> **[Configure Publisher](https://discuss.overhang.io/t/configure-publisher/2888)**
>
> I want to install publisher but not installing i am getting cors error always please guide me how to resolve this cors error Unable to load data: Axios Error (Request): Network Error (possible local connectivity issue) get...

---

<div class="post-metadata">

**Author:** ![BbrSofiane](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/bbrsofiane/32/561_2.png) [@BbrSofiane](https://discuss.openedx.org/u/BbrSofiane)\
**Post date:** [June 12, 2022, 12:00pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/5 "2022-06-12T12:00:19Z")

</div>

⚠ Disclaimer: This plugin is in an experimental state so there is no guarantee it will work, especially on the latest release. If you need something that works out of the box, this is probably not the right tool.

> Access to XMLHttpRequest at ‘[https://discovery.xxxx.in/publisher/api/admins/organizations/users/?page=1&page\_size=250’](https://discovery.xxxx.in/publisher/api/admins/organizations/users/?page=1&page_size=250%E2%80%99) from origin ‘[https://apps.xxxx.in](https://apps.xxxx.in/)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
> 
> Access to XMLHttpRequest at ‘[https://discovery.xxxx.in/api/v1/organizations/?page=1&page\_size=500&limit=500’](https://discovery.xxxx.in/api/v1/organizations/?page=1&page_size=500&limit=500%E2%80%99) from origin ‘[https://apps.xxxx.in](https://apps.xxxx.in/)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Hmm, can you check the settings file for the discovery service? I’ve added the MFE domain to CORS whitelist in [discovery-development-settings](https://github.com/Dicey-Tech/tutor-contrib-publisher/blob/main/publisher/patches/discovery-development-settings) and [discovery-production-settings](https://github.com/Dicey-Tech/tutor-contrib-publisher/blob/main/publisher/patches/discovery-production-settings).

Can you describe the steps you to took to install, enable and run the MFE?

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 12, 2022, 12:25pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/6 "2022-06-12T12:25:42Z")

</div>

So what I have tried so far is as follows

1. Install tutor full on local

2. tutor plugins enable discovery ecommerce

3. tutor config save

4. Create a discovery user  
tutor local run discovery ./manage.py createsuperuser

5. Create a plugin using .yml in tutor plugin printroot tweeking discovery-production-settings to append MFE host as cors allowed origin

name: cors  
version: 0.0.1  
patches:  
discovery-production-settings: |  
CORS\_ORIGIN\_WHITELIST = list(CORS\_ORIGIN\_WHITELIST) + [“[https://apps.xxxx.in](https://apps.xxxx.in)”]

1. Enable this patch along with your publisher mfe  
pip install git+https://github.com/Dicey-Tech/tutor-contrib-publisher

2. Run quickstart again

So far i have been able to successfully login to publisher. Dashboard works fine.

The issue comes up while trying to create new course about csrf tokens

I have tried tweeking lms-env through patch to add csrf trusted domain but that doesn’t seem to work for me.

I explicitly do not need publisher to utilize any features of it. However I wished my courses to have schedules (i.e. relative due dates). And I don’t remember where exactly but documentation somewhere mentioned that to enable relative due dates in self paced courses we will need to end the course through publisher. Which is quite abnormal to me. Is that the case? Because I am able to set up due dates for instructor paced course but same is not true for self paced. Any thoughts on this if we can bypass publisher just for ending the course (date)?

---

<div class="post-metadata">

**Author:** ![BbrSofiane](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/bbrsofiane/32/561_2.png) [@BbrSofiane](https://discuss.openedx.org/u/BbrSofiane)\
**Post date:** [June 12, 2022, 12:52pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/7 "2022-06-12T12:52:26Z")

</div>

> [@Manoj\_kumar](#):
>
> However I wished my courses to have schedules (i.e. relative due dates). And I don’t remember where exactly but documentation somewhere mentioned that to enable relative due dates in self paced courses we will need to end the course through publisher.

That’s completely fair and that’s also how I ended up trying to create this plugin. I do think the underlying issue is that there is a dependency to a functionality that’s not core (publisher) to edit something that is (course).

> [@Manoj\_kumar](#):
>
> Create a plugin using .yml in tutor plugin printroot tweeking discovery-production-settings to append MFE host as cors allowed origin

In theory, you shouldn’t need that, it’s already taken care of in the publisher plugin.

Have you tried creating a new course run for a course that exists? Does that work?

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 12, 2022, 2:16pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/8 "2022-06-12T14:16:53Z")

</div>

Yes I have tried but at the time of saving it is giving error please guide us we can create that plugins with this repo [GitHub - openedx/frontend-app-publisher: Publisher frontend to manage course creation and marketing content curation.](https://github.com/openedx/frontend-app-publisher) or we have to take from your repo please guide how we can make that thing working

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 12, 2022, 3:27pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/9 "2022-06-12T15:27:32Z")

</div>

@BbrSofiane

while we create a course this is exact error pops up.

Creation failed, please try again or contact support.  
detail: CSRF Failed: Referer checking failed - [https://apps.xxxx.in/](https://apps.xxxx.in/) does not match any trusted origins.

console prints the following

xhr.js:210 POST [https://discovery.xxxx.in/api/v1/courses/](https://discovery.xxxx.in/api/v1/courses/) 403

Logs from tutor discovery prints as below

discovery\_1 | 2022-06-12 15:11:57,034 WARNING 6 [django.request] /openedx/venv/lib/python3.8/site-packages/django/utils/log.py:224 - Forbidden: /api/v1/courses/  
discovery\_1 | 2022-06-12 15:11:57,034 WARNING 6 [django.request] /openedx/venv/lib/python3.8/site-packages/django/utils/log.py:224 - Forbidden: /api/v1/courses/  
discovery\_1 | 2022-06-12 15:11:57,034 WARNING 6 [django.request] /openedx/venv/lib/python3.8/site-packages/django/utils/log.py:224 - Forbidden: /api/v1/courses/  
discovery\_1 | [pid: 6|app: 0|req: 14/31] 172.18.0.8 () {68 vars in 3405 bytes} [Sun Jun 12 15:11:57 2022] POST /api/v1/courses/ =\> generated 109 bytes in 19 msecs (HTTP/1.1 403) 8 headers in 295 bytes (1 switches on core 0)

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 13, 2022, 9:52am UTC](https://discuss.openedx.org/t/configure-publisher/7439/10 "2022-06-13T09:52:17Z")

</div>

I am facing issue in creating a path for publisher for CORS and CSRF errors

name: cors  
version: 0.0.1  
patches:  
openedx-lms-settings: |  
CORS\_ORIGIN\_WHITELIST.append("{{ MFE\_HOST }}")  
CORS\_ORIGIN\_CREDENTIALS = True  
CORS\_ORIGIN\_ALLOW\_ALL = True  
CROSS\_DOMAIN\_CSRF\_COOKIE\_DOMAIN = xxxx.in  
CROSS\_DOMAIN\_CSRF\_COOKIE\_NAME = native-csrf-cookie  
CSRF\_COOKIE\_SECURE = True  
CSRF\_TRUSTED\_ORIGINS = list(CSRF\_TRUSTED\_ORIGIN) + [“[https://apps.xxxx.in](https://apps.xxxx.in/)”]  
DCS\_SESSION\_COOKIE\_SAMESITE = lax  
DCS\_SESSION\_COOKIE\_SAMESITE\_FORCE\_ALL = True

Please help me to create a patch

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [June 15, 2022, 6:49pm UTC](https://discuss.openedx.org/t/configure-publisher/7439/11 "2022-06-15T18:49:50Z")

</div>

@BbrSofiane I believe that the entries in CORS\_ORIGIN\_WHITELIST should be prefixed by “http(s)://” [tutor-mfe/openedx-lms-production-settings at df5d86eb35429ba1b3fd961c9b3ee8d333eded5e · overhangio/tutor-mfe · GitHub](https://github.com/overhangio/tutor-mfe/blob/df5d86eb35429ba1b3fd961c9b3ee8d333eded5e/tutormfe/patches/openedx-lms-production-settings#L15)  
On the other hand CSRF\_TRUSTED\_ORIGINS should not.  
(I recently faced a similar problem in ecommerce)

---

<div class="post-metadata">

**Author:** ![Manoj\_kumar](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/manoj_kumar/32/3488_2.png) [@Manoj\_kumar](https://discuss.openedx.org/u/Manoj_kumar)\
**Post date:** [June 16, 2022, 10:11am UTC](https://discuss.openedx.org/t/configure-publisher/7439/12 "2022-06-16T10:11:38Z")

</div>

name: corsxlms  
version: 0.0.1  
patches:  
discovery-production-settings: |  
CORS\_ORIGIN\_WHITELIST = list(CORS\_ORIGIN\_WHITELIST) + [“[https://apps.xxxx.in](https://apps.xxxx.in)”]  
lms-env: |  
CORS\_ORIGIN\_WHITELIST:  
- [https://xxxx.in](https://xxxx.in)  
- [https://apps.xxxx.in](https://apps.xxxx.in)  
- [https://discovery.xxxx.in](https://discovery.xxxx.in)  
CSRF\_TRUSTED\_ORIGINS:  
- xxxx.in  
- apps.xxxx.in  
- discovery.xxxx.in  
adding csrf trusted origins to discovery results in error parameter not defined while quickstart

please guide

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/e/e0015f89e879bc75925b71fd11133ab15fe98297.png) [@system](https://discuss.openedx.org/u/system)\
**Post date:** [September 14, 2022, 10:12am UTC](https://discuss.openedx.org/t/configure-publisher/7439/13 "2022-09-14T10:12:14Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
