Hello, I am trying to connect a custom front end: https://github.com/edx/frontend-platform to tutor.
I am currently running tutor local quickstart
but in a test environment. However, I have the same issues when running in devmode.
In order to enable Cors request from the front end application, I made this plugin:
name: CORS
version: 0.2.0
patches:
openedx-common-settings: |
from corsheaders.defaults import default_headers as corsheaders_default_headers
FEATURES['ENABLE_CORS_HEADERS'] = True
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_WHITELIST = ('localhost:8080')
CORS_ALLOW_HEADERS = corsheaders_default_headers + (
'use-jwt-cookie',
)
This seems to fix my issues regarding Cors, however, my main issue is retrieving cookies from the local instance of tutor, running on local.overhang.io:80
This is how I have configured env.development on the frontend:
EXAMPLE_VAR=Example Value
ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload
BASE_URL=localhost:8080
CREDENTIALS_BASE_URL=http://localhost:18150
CSRF_TOKEN_API_PATH=/csrf/api/v1/token
DISCOVERY_API_BASE_URL=http://localhost:18381
PUBLISHER_BASE_URL=http://localhost:18400
ECOMMERCE_BASE_URL=http://localhost:18130
LANGUAGE_PREFERENCE_COOKIE_NAME=openedx-language-preference
LMS_BASE_URL=http://local.overhang.io:80
LOGIN_URL=http://local.overhang.io:80/login
LOGOUT_URL=http://local.overhang.io:80/logout
MARKETING_SITE_BASE_URL=http://localhost:18000
ORDER_HISTORY_URL=localhost:1996/orders
REFRESH_ACCESS_TOKEN_ENDPOINT=http://local.overhang.io:80/login_refresh
SEGMENT_KEY=ul
SITE_NAME=Open edX
USER_INFO_COOKIE_NAME=edx-user-info
I don’t have all of the plugins installed in tutor, but I have tested with and without ecommerce and discovery, but it did not make a difference.
The application is able to communicate with tutor, but unable to retrieve any cookies, once I have logged in. This is causing this error in the application:
1. Error {message: "[frontend-auth] Access token is still null after successful refresh."}
1. {axiosResponse: {…}}
1. axiosResponse: {data: {…}, status: 200, statusText: "OK", headers: {…}, config: {…}, …}
2. __proto__: Object
NewRelicLoggingService.js?484b:81 Error: Access token is still null after successful refresh. at _callee$ (AxiosJwtTokenService.js?0c2a:87) at tryCatch (runtime.js?f3a2:65) at Generator.invoke [as _invoke] (runtime.js?f3a2:303) at Generator.prototype.<computed> [as next] (runtime.js?f3a2:117) at asyncGeneratorStep (AxiosJwtTokenService.js:10) at _next (AxiosJwtTokenService.js:12)
1. {axiosResponse: {…}}
1. axiosResponse: {data: {…}, status: 200, statusText: "OK", headers: {…}, config: {…}, …}
2. __proto__: Object
This works perfectly when running the latest native devstack version of openedx.
Any help regarding this problem would be greatly appreciated.