Skip to content

CORS errors when entering directly MFE host through the browser and not by redirections #1080

@mariajgrimaldi

Description

@mariajgrimaldi

Description

When opening the https://apps.redwood.demo.edly.io/course-authoring/home directly w/o opening the https://studio.redwood.demo.edly.io and then being redirected, a CORS error is raised when trying to use the MFE. In this case the MFE doing the request for oauth2 to login into the studio and failed because of CORS. When I'm opening the Studio MFE from studio.redwood.demo.edly.io I became a logged in user and the login flow from MFE is not triggered.

Expected behavior

Request to became a Course creator is sent, an appropriate message is displayed

Actual behavior

I get an error Sorry, there was error with you request.
Console logs:

home:1 Access to XMLHttpRequest at 'https://redwood.demo.edly.io/oauth2/authorize?client_id=cms-sso&redirect_uri=https%3A%2F%2Fstudio.redwood.demo.edly.io%2Fcomplete%2Fedx-oauth2%2F%3Fredirect_state%3DnWpdAjq4Qqrjji7z9koTja6UvhjoviKz&state=nWpdAjq4Qqrjji7z9koTja6UvhjoviKz&response_type=code&scope=user_id+profile+email' (redirected from 'https://studio.redwood.demo.edly.io/request_course_creator') from origin 'https://apps.redwood.demo.edly.io' 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.
Screenshot 2024-06-05 at 15 25 26

Steps to reproduce

  1. Register a new User
  2. Open Studio https://apps.redwood.demo.edly.io/course-authoring/home
  3. Click on Becoming a course creator in Studio area below the text Are you staff on an existing Studio course? The course creator must give you access to the course. Contact the course creator or administrator for the course you are helping to author.
  4. Click on Request the abillity to create courses button.

Original issue: openedx/wg-build-test-release#379

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedReady to be picked up by anyone in the communityrelease testingAffects the upcoming release (attention needed)

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions