Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable requests from liveapp (CORS, CSRF) #17

Open
vthily opened this issue Jun 28, 2021 · 1 comment · Fixed by #18
Open

Enable requests from liveapp (CORS, CSRF) #17

vthily opened this issue Jun 28, 2021 · 1 comment · Fixed by #18
Assignees
Labels
bug Something isn't working

Comments

@vthily
Copy link

vthily commented Jun 28, 2021

Enable requests from liveapp (CORS, CSRF)

-The current app in steamforvietnam.org is working fine.
-Settings in steamforvietnam.net is NOT working (changes related to the koa.2 codebase, some environment variables are deprecated or moved).

@vthily vthily self-assigned this Jun 28, 2021
@vthily vthily added the bug Something isn't working label Jun 28, 2021
@vthily
Copy link
Author

vthily commented Jun 29, 2021

  1. Update in the edx-platform/cms/envs/common.py
... # Inside the features
    'ENABLE_CORS_HEADERS': True,
    'ENABLE_CROSS_DOMAIN_CSRF_COOKIE': True,
...

CORS_ORIGIN_WHITELIST = ['live.steamforvietnam.org', 'www.live.steamforvietnam.org', 'live.steamforvietnam.net', 'www.live.steamforvietnam.net']
CORS_ORIGIN_ALLOW_ALL = False

LOGIN_REDIRECT_WHITELIST = []

############### Settings for video pipeline ##################
VIDEO_UPLOAD_PIPELINE = {
    'BUCKET': '',
    'ROOT_PATH': '',
}
  1. Update in the edx-platform/lms/envs/common.py
    # Allows to configure the LMS to provide CORS headers to serve requests from other domains
    'ENABLE_CORS_HEADERS': True,
  1. config/lms.env.json and config/cms.env.json
    "ENABLE_CROSS_DOMAIN_CSRF_COOKIE": true
  },
  "CROSS_DOMAIN_CSRF_COOKIE_DOMAIN": "steamforvietnam.net",
  "CROSS_DOMAIN_CSRF_COOKIE_NAME": "steamvn-csrftoken",
  "CSRF_TRUSTED_ORIGINS": ["live.steamforvietnam.org", "www.live.steamforvietnam.org", "live.steamforvietnam.net", "www.live.steamforvietnam.net"],

@vthily vthily linked a pull request Jul 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant