openedx / wg-build-test-release

Open edX Build / Test / Release Working Group
25 stars 15 forks source link

[Test failure] <TC_AUTHOR_146>: Can't request a Course creator role in Studio #379

Open cmltaWt0 opened 6 months ago

cmltaWt0 commented 6 months ago

Release

Redwood

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.

Additional information

The user was activated manually via admin panel.

mariajgrimaldi commented 6 months ago

Thanks for the report! I followed the instructions to reproduce the issue but couldn't.

Screencast from 05-06-24 23:12:51.webm

Could you try again, please?

cmltaWt0 commented 6 months ago

It doesn't work for me yet.

https://github.com/openedx/wg-build-test-release/assets/877401/abd8d33e-ca2c-46b5-ada8-341f5c916807

But it works for our QA...

cmltaWt0 commented 6 months ago

@mariajgrimaldi We've found the root-cause! (thanks @dyudyunov !) I'm opening the https://apps.redwood.demo.edly.io/course-authoring/home directly w/o opening the https://studio.redwood.demo.edly.io in the first place. 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.

mariajgrimaldi commented 5 months ago

@cmltaWt0 @dyudyunov: thank you both for the insight! I'm not sure if this is the intended behavior, so I opened an issue in the Course Authoring MFE to alert maintainers.